From 67bbdbed82999d7a5bcd4550c0deb0018c214bcd Mon Sep 17 00:00:00 2001 From: shroomtoastie <141182377+shroomtoastie@users.noreply.github.com> Date: Sat, 2 Nov 2024 18:32:03 -0400 Subject: [PATCH] Fizz Buzz Challenge --- fizzbuzz.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fizzbuzz.py b/fizzbuzz.py index 218f7aa..5ce3a14 100644 --- a/fizzbuzz.py +++ b/fizzbuzz.py @@ -1,2 +1,16 @@ # add your code here +# Create range from 1-100 +for i in range(1,101): + # Creating program to identify numbers divisible by 3 and 5 and replace with "FizzBuzz" + if i % 3 == 0 and i % 5 == 0: + print("FizzBuzz") + # identify numbers divisible by 3 and replace them with "Fizz" + elif i % 3 == 0: + print("Fizz") + # identify numbers divisible by 5 and replace them with "Buzz" + elif i % 5 == 0: + print("Buzz") + # identify and show all other numbers in range 1-100 + else: + print(i)