From 572e57fcf47ff78e1d4548016e9879ebb43bc3ea Mon Sep 17 00:00:00 2001 From: PreedhiVivek Date: Fri, 20 Sep 2019 11:44:34 +0530 Subject: [PATCH 1/2] Function issue fixed --- 11_challenge/11_challenge.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/11_challenge/11_challenge.py b/11_challenge/11_challenge.py index 123d406..c9edcb3 100644 --- a/11_challenge/11_challenge.py +++ b/11_challenge/11_challenge.py @@ -14,12 +14,13 @@ def fizzbuzz(max_num): # Google for 'range in python' to see what it does for i in range(1,max_num): # % or modulo division gives you the remainder - if i%3==0: + if (i%3==0 and i%5==0): + print(i,"fizzbuzz") + elif (i%3==0): print(i,"fizz") - elif i%5==0: + elif (i%5==0): print(i,"Buzz") - elif i%3==0 and i%5==0: - print(i,"fizzbuzz") + #----START OF SCRIPT if __name__=='__main__': From 22f9c116a8b1a10990e8b046d7d609648f9f5ee5 Mon Sep 17 00:00:00 2001 From: PreedhiVivek Date: Wed, 25 Sep 2019 15:08:11 +0530 Subject: [PATCH 2/2] fixed 13_challenge --- 13_challenge/13_challenge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/13_challenge/13_challenge.py b/13_challenge/13_challenge.py index e7828f6..f856397 100644 --- a/13_challenge/13_challenge.py +++ b/13_challenge/13_challenge.py @@ -14,13 +14,13 @@ def fizzbuzz(max_num): # adding some redundant declarations on purpose # we will make our script 'tighter' in one of coming exercises - three_mul = 'fizz + three_mul = 'fizz' five_mul = 'buzz' num1 = 3 num2 = 5 # Google for 'range in python' to see what it does - for i in range(1,max_num) + for i in range(1,max_num): # % or modulo division gives you the remainder if i%num1==0 and i%num2==0: print(i,three_mul+five_mul) @@ -31,4 +31,4 @@ def fizzbuzz(max_num): #----START OF SCRIPT if __name__=='__main__': - fizzbuzzy(100) + fizzbuzz(100)