About 457,000 results
Open links in new tab
  1. Python Iterators - W3Schools

    Example. Create an iterator that returns numbers, starting with 1, and each sequence will increase by one (returning 1,2,3,4,5 etc.):

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

    Aug 24, 2023 · In Python, iterable and iterator have specific meanings. An iterable is an object that has an __iter__ method which returns an iterator, or which defines a __getitem__ method …

  3. Iterators in Python - GeeksforGeeks

    Dec 16, 2024 · An iterator in Python is an object that holds a sequence of values and provide sequential traversal through a collection of items such as lists, tuples and dictionaries. . The …

  4. Python Iterators (With Examples) - Programiz

    Iterators are methods that iterate collections like lists, tuples, etc. Using an iterator method, we can loop through an object and return its elements. Technically, a Python iterator object must …

  5. Iterators and Iterables in Python: Run Efficient Iterations

    Jan 6, 2025 · Python iterators are objects with .__iter__() and .__next__() methods. Iterables are objects that can return an iterator using the .__iter__() method. Generator functions use the …

  6. Python Iterator: Example Code and How it Works

    Jun 24, 2024 · What is a Python iterator? Learn it here, including lots of example code to iterate lists, dictionaries, files, and generators.

  7. Python Iterators - Python Geeks

    Learn what are Python iterators with working and examples. See how to create iterators & how to use the next() function.

  8. Python Iterators with examples: Creation and Usage Guide

    Aug 23, 2024 · In Python, an iterator is an object that can be iterated (looped) upon. An iterator returns one element at a time from a sequence, like a list, tuple, or string. Understanding …

  9. Python Loop: Iterating Through Certain Numbers - CodeRivers

    Jan 24, 2025 · Using for Loop to Iterate Through Certain Numbers. The most common way to iterate through a sequence of numbers is by using a for loop with the range function. For …

  10. Iterables in Python

    Iterables are containers that can store multiple values and are capable of returning them one by one. Iterables can store any number of values. In Python, the values can either be the same …

  11. Some results have been removed
Refresh