Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##
- # [for_itools_counttwa.py]
- #
- # Infinite for loop (using itertools.count() and itertools.takewhile())
- ##
- from itertools import takewhile
- from itertools import count
- def thereIsAReasonToContinue(i):
- return True
- for i in takewhile(thereIsAReasonToContinue, count()):
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement