3 ms·
Just to illustrate: >>> for item in (1,2): print(item) else: print('Done!') 1 2 Done! >>> for item in (1,2): print(item
by maxerickson 12y ago
Just to illustrate:
>>> for item in (1,2):
print(item)
else:
print('Done!')
1
2
Done!
>>> for item in (1,2):
print(item)
break
else:
print('Done!')
1
>>>
edit: also:
>>> for item in ():
print(item)
else:
print('Done')
Done