In this question , I have an infinite sequence using Python generators. But the same code does not work in Python 3 because there seems to be no next() function. What is equivalent to next function?
def updown(n): while True: for i in range(n): yield i for i in range(n - 2, 0, -1): yield i uptofive = updown(6) for i in range(20): print(uptofive.next())
Max 05 Sep '12 at 4:45 2012-09-05 04:45
source share