pocketpy/tests/28_iter.py
blueloveTH 755140084a ...
2023-04-19 13:25:34 +08:00

13 lines
147 B
Python

a = [1, 2, 3]
a = iter(a)
total = 0
while True:
obj = next(a)
if obj is StopIteration:
break
total += obj
assert total == 6