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