About 26,700,000 results
Open links in new tab
  1. Python: next() function - Stack Overflow

    Since I'm an absolute beginner, and the author hasn't provided any explanation of the example or the next () function, I don't understand what the code is doing.

  2. Python list iterator behavior and next(iterator) - Stack Overflow

    May 29, 2013 · In other words, next() is working as expected, but because it returns the next value from the iterator, echoed by the interactive interpreter, you are led to believe that the …

  3. python - Getting next element while cycling through a list - Stack …

    The idea is to access the next element while iterating. On reaching the penultimate element, you can access the last element. Use enumerate method to add index or counter to an iterable …

  4. Get the first item from an iterable that matches a condition

    Python <= 2.5 The .next() method of iterators immediately raises StopIteration if the iterator immediately finishes -- i.e., for your use case, if no item in the iterable satisfies the condition.

  5. python - Using next () on generator function - Stack Overflow

    May 28, 2018 · And each time you call the next on it you'll get the first item which is 0 * 0 because you're not calling the next on same object (each time a new one). But in second case you're …

  6. python - What are the iteration class methods next () and __next__ ...

    Sep 9, 2017 · 8 next has been renamed to __next__ in Python 3. As for what it does, it should return the next item, or raise StopIteration if there are no more.

  7. python - Why does next raise a 'StopIteration', but 'for' do a …

    Why does next raise a 'StopIteration', but 'for' do a normal return? Asked 12 years, 10 months ago Modified 6 years, 6 months ago Viewed 186k times

  8. if pass and if continue in python - Stack Overflow

    There is a fundamental difference between pass and continue in Python. pass simply does nothing, while continue jumps to the next iteration of the for loop. The statement if not 0 always …

  9. Python, next iteration of the loop over a loop - Stack Overflow

    Aug 4, 2016 · Python, next iteration of the loop over a loop Asked 15 years, 10 months ago Modified 9 years, 4 months ago Viewed 45k times

  10. hasnext() for Python iterators? - Stack Overflow

    (For context, iterators in Java and C# have a hasNext() as well as Next(). Python obviates this by throwing an exception at generator end. And the next(gen, default_value) idiom allows you to …