Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fizz_buzz(max_times):
- print()
- i = 1
- while i <= max_times:
- if i%15==0:
- print("FizzBuzz") if i%10==0 else print("FizzBuzz ", end="")
- elif i%3==0:
- print("Fizz") if i%10==0 else print("Fizz ", end="")
- elif i%5==0:
- print("Buzz") if i%10==0 else print("Buzz ", end="")
- else:
- print(i) if i%10==0 else print(str(i) + " ", end="")
- i += 1
- fizz_buzz(100)
Add Comment
Please, Sign In to add comment