From 323be30feb6688d3fceb6ddb99649ea613889191 Mon Sep 17 00:00:00 2001 From: Prathima Kadari Date: Tue, 18 May 2021 14:58:48 +0530 Subject: [PATCH] Added fizzbuzz program --- fizzbuzz.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 fizzbuzz.py diff --git a/fizzbuzz.py b/fizzbuzz.py new file mode 100644 index 0000000..99c1096 --- /dev/null +++ b/fizzbuzz.py @@ -0,0 +1,15 @@ +# FizzBuzz: Return Fizz for multiples of 3 and Buzz for multiples of 2. + +def fizzBuzz(max=100): + for n in range(1, max): + print(n) + if n % 3 == 0 and n % 2 == 0: + print('FizzBuzz') + continue + elif n % 3 == 0: + print('Fizz') + continue + elif n % 2 == 0: + print('Buzz') + +fizzBuzz()