A counting game for children.
★★☆Fizz buzz is a counting game for children to teach them about division. Players take turns to count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz".
Write a program to show the output of the game Fizz Buzz up to a number entered by the user.
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
fizz_buzz that:x that is the number to count up to.fizz_buzz subprogram.1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
Fizz Buzz
# Fizz buzz program
# -------------------------
# Subprograms
# -------------------------
---
# Subroutine to output Fizz for multiples of 3 and Buzz for multiples of 5
def fizz_buzz(x):
---
# Loop from 1 to x
for counter in range(1, x + 1):
---
# Multiple of 3 and 5
---
if counter % 3 == 0 and counter % 5 == 0:
---
print("Fizz Buzz")
---
# Multiple of 3 only
---
elif counter % 3 == 0:
---
print("Fizz")
---
# Multiple of 5 only
---
elif counter % 5 == 0:
---
print("Buzz")
---
# Not multiple of 3 or 5
---
else:
---
print(counter)
---
# -------------------------
# Main program
# -------------------------
---
maximum = int(input("What number should the count be up to? :"))
---
fizz_buzz(maximum)