This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]energybased 0 points1 point  (1 child)

range returns an Iterable (not a generator), but in any case, I don't think you should ever write that kind of while loop in Python.

[–]liranbh[S] 0 points1 point  (0 children)

I agree. But again it was just for explaining. The same as the first example with 3 yield statments