1def fizz_buzz(input):
2 if (input % 3 == 0) and (input % 5 == 0):
3 return "FizzBuzz"
4 if input % 3 == 0:
5 return "Fizz"
6 if input % 5 == 0:
7 return "Buzz"
8 else:
9 return input
10
11
12print(fizz_buzz(3))
1def fizz_buzz(Ending_number:int):
2 """This is a fizz buzz game the starting number would be taken as 1"""
3 for numbers in range(1,Ending_number):
4 if numbers % 3 == 0 and numbers % 5 == 0:
5 print("fizz buzz")
6 elif numbers % 3 == 0:
7 print("buzz")
8 elif numbers % 35 == 0:
9 print("fizz")
10 else:
11 print(numbers)
12print(fizz_buzz(120))
1for x in range(100):
2 output = ""
3 if x % 3 == 0:
4 output += "Fizz"
5 if x % 5 == 0:
6 output += "Buzz"
7 print(output)
1#made by myself :)
2def FizzBuzz() :
3 Numbers = 0
4 for Numbers in range(101):
5 if Numbers%3 == 0:
6 print ("Fizz")
7 if Numbers%5 == 0:
8 print ("Buzz")
9 if Numbers%3 == 0 and Numbers%5 ==0:
10 print ("Fizz Buzz")
11 else :
12 print (Numbers)
13FizzBuzz()
1inputValue = int(input("Enter a Number: "))
2
3if inputValue % 3 == 0 and inputValue % 5 == 0 :
4 print("fizzbuzz")
5elif inputValue % 3 == 0 :
6 print("fizz")
7elif inputValue % 5 == 0 :
8 print("buzz")
9else:
10 print(inputValue)