About 8,050 results
Open links in new tab
  1. Iterators and Iterables in Python: Run Efficient Iterations

    Jan 6, 2025 · In this tutorial, you'll learn what iterators and iterables are in Python. You'll learn how they differ and when to use them in your code. You'll also learn how to create your own iterators and …

  2. Iterables in Python

    Iterables can store any number of values. In Python, the values can either be the same type or different types. Python has several types of iterables. Types of Iterables in Python 1. List in python A list is the …

  3. Functions creating iterators for efficient looping - Python

    2 days ago · itertools.combinations_with_replacement(iterable, r) ¶ Return r length subsequences of elements from the input iterable allowing individual elements to be repeated more than once. The …

  4. Python Iterators - W3Schools

    Python Iterators An iterator is an object that contains a countable number of values. An iterator is an object that can be iterated upon, meaning that you can traverse through all the values. Technically, in …

  5. python - What are iterator, iterable, and iteration? - Stack Overflow

    So an iterable is an object that you can get an iterator from. An iterator is an object with a next (Python 2) or __next__ (Python 3) method. Whenever you use a for loop, or map, or a list comprehension, …

  6. Iterator Objects — Python 3.14.6 documentation

    2 days ago · Iterator Objects ¶ Python provides two general-purpose iterator objects. The first, a sequence iterator, works with an arbitrary sequence supporting the __getitem__ () method. The …

  7. Iterators in Python - GeeksforGeeks

    Jun 5, 2026 · Python provides built-in iterators for iterable objects such as strings, lists, tuples, and dictionaries. These iterators allow elements to be accessed one at a time using the next () function.

  8. Python | Difference between iterable and iterator - GeeksforGeeks

    Jul 11, 2025 · Iterable is an object, that one can iterate over. It generates an Iterator when passed to iter () method. An iterator is an object, which is used to iterate over an iterable object using the __next__ …

  9. Iterable in Python - pythonbasics.org

    Iterable in Python An iteratable is a Python object that can be used as a sequence. You can go to the next item of the sequence using the next () method. You can loop over an iterable, but you cannot …

  10. An Essential Guide to Python Iterables By Practical Examples

    Python Iterables Summary: in this tutorial, you’ll learn about the Python iterables and iterators. Introduction to Python iterables In Python, an iterable is an object that includes zero, one, or many …