Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def solution(N):
- for i in range(1, N+1):
- text = []
- if i%3 == 0:
- text.append("Fizz")
- if i%5 == 0:
- text.append("Buzz")
- if i%7 == 0:
- text.append("Woof")
- if text:
- print(''.join(text))
- else:
- print(i)
- # --- tests ---
- solution(3*5*7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement