generator done

This commit is contained in:
2025-03-24 16:00:37 +00:00
parent 3a195b2260
commit 9032feca0b
7 changed files with 92 additions and 0 deletions

10
generators/special_for.py Normal file
View File

@@ -0,0 +1,10 @@
def special_for(iterable):
iterator = iter(iterable)
while True:
try:
print(next(iterator))
except StopIteration:
break
special_for([1,2,3])