Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import count
- def fizzbuzz():
- for n in count(1):
- word = ""
- if n % 3 == 0:
- word += "Fizz"
- if n % 5 == 0:
- word += "Buzz"
- yield (word if word else n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement