From 624173b090cf1bc730c27dddaf4c0fa46199ff94 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 11:31:58 +0530 Subject: [PATCH 01/10] fixed the argument passing error --- 02_challenge/02_challenge.py | 3 ++- 02_challenge/02_readme.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/02_challenge/02_challenge.py b/02_challenge/02_challenge.py index b41cd50..d41d4e9 100644 --- a/02_challenge/02_challenge.py +++ b/02_challenge/02_challenge.py @@ -23,4 +23,5 @@ def fizzbuzz(max_num): #----START OF SCRIPT if __name__=='__main__': - fizzbuzz() + max = int(input('enter the number : ')) + fizzbuzz(max) diff --git a/02_challenge/02_readme.md b/02_challenge/02_readme.md index e69de29..ef01bbb 100644 --- a/02_challenge/02_readme.md +++ b/02_challenge/02_readme.md @@ -0,0 +1,2 @@ +As the error clearly said missing argument , either had to hard code the argument or take it from the console. +now the argument is getting from the console. \ No newline at end of file From a1dc8bd509e9ae8365221a5d642aa8fbc87f7877 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 11:52:55 +0530 Subject: [PATCH 02/10] removed quotes for an integer --- 03_challenge/03_challenge.py | 2 +- 03_challenge/03_readme.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/03_challenge/03_challenge.py b/03_challenge/03_challenge.py index 6e67d1f..2e4cd35 100644 --- a/03_challenge/03_challenge.py +++ b/03_challenge/03_challenge.py @@ -23,4 +23,4 @@ def fizzbuzz(max_num): #----START OF SCRIPT if __name__=='__main__': - fizzbuzz('16') + fizzbuzz(16) diff --git a/03_challenge/03_readme.md b/03_challenge/03_readme.md index e69de29..460cec0 100644 --- a/03_challenge/03_readme.md +++ b/03_challenge/03_readme.md @@ -0,0 +1,2 @@ +TypeError: 'str' object cannot be interpreted as an integer +fix: removed quotes for integer \ No newline at end of file From 000621137cb49e3ad0086cd8e85c7a71a716adff Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 12:01:58 +0530 Subject: [PATCH 03/10] fixed indentation of the if block --- 04_challenge/04_challenge.py | 2 +- 04_challenge/readme.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/04_challenge/04_challenge.py b/04_challenge/04_challenge.py index a3f5edf..f856397 100644 --- a/04_challenge/04_challenge.py +++ b/04_challenge/04_challenge.py @@ -23,7 +23,7 @@ def fizzbuzz(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) + print(i,three_mul+five_mul) elif i%num1==0: print(i,three_mul) elif i%num2==0: diff --git a/04_challenge/readme.md b/04_challenge/readme.md index e69de29..4f7b377 100644 --- a/04_challenge/readme.md +++ b/04_challenge/readme.md @@ -0,0 +1,2 @@ +IndentationError: expected an indented block +fix : changed the indentation of the if block. \ No newline at end of file From f4fa7242ff159f2dc711c852f2c87a8ec6c820f5 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 12:19:05 +0530 Subject: [PATCH 04/10] rectified print statement with missing parenthesis at line 21 --- 05_challenge/05_challenge.py | 4 ++-- 05_challenge/05_readme.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/05_challenge/05_challenge.py b/05_challenge/05_challenge.py index 0f9bdbd..e50f34f 100644 --- a/05_challenge/05_challenge.py +++ b/05_challenge/05_challenge.py @@ -17,8 +17,8 @@ def fizzbuzz(max_num): # we will make our script 'tighter' in one of coming exercises three_mul = 'fizz' five_mul = 'buzz' - with open('mifile.txt','r') as f: - print 'i have created' + with open('myfile.txt','r') as f: + print('i have created') num1 = int(f.readline()) num2=int(f.readline()) max_num = int(f.readline()) diff --git a/05_challenge/05_readme.md b/05_challenge/05_readme.md index e69de29..dd33853 100644 --- a/05_challenge/05_readme.md +++ b/05_challenge/05_readme.md @@ -0,0 +1 @@ +parenthesis was missing at line 21 for the print statement so added them. \ No newline at end of file From 55b303d4e9098ba75fc46385d8d9e44b7b5f79f1 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 12:28:43 +0530 Subject: [PATCH 05/10] replaced num by num2 as num is not defiend. --- 06_challenge/06_challenge.py | 2 +- 06_challenge/06_readme.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/06_challenge/06_challenge.py b/06_challenge/06_challenge.py index b09e24e..d8d4483 100644 --- a/06_challenge/06_challenge.py +++ b/06_challenge/06_challenge.py @@ -18,7 +18,7 @@ def fizzbuzz(max_num): three_mul = 'fizz' five_mul = 'buzz' num1 = conf.num1 - num2 = conf.num + num2 = conf.num2 # Google for 'range in python' to see what it does for i in range(1,max_num): # % or modulo division gives you the remainder diff --git a/06_challenge/06_readme.md b/06_challenge/06_readme.md index e69de29..c29b859 100644 --- a/06_challenge/06_readme.md +++ b/06_challenge/06_readme.md @@ -0,0 +1,3 @@ +AttributeError: module 'conf' has no attribute 'num' +num was typed, instead of num2. +replaced num by num2. \ No newline at end of file From 1d00768d3c2fd47df3b3e2ba3c12fb98bdb76bbb Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 13:11:22 +0530 Subject: [PATCH 06/10] replaced max_num with max_num+1 to get required result --- 07_challenge/07_challenge.py | 2 +- 07_challenge/07_readme.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/07_challenge/07_challenge.py b/07_challenge/07_challenge.py index dbe1bb1..ac92421 100644 --- a/07_challenge/07_challenge.py +++ b/07_challenge/07_challenge.py @@ -20,7 +20,7 @@ def fizzbuzz(max_num): 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+1): # % or modulo division gives you the remainder if i%num1==0 and i%num2==0: print(i,three_mul+five_mul) diff --git a/07_challenge/07_readme.md b/07_challenge/07_readme.md index e69de29..169d3b1 100644 --- a/07_challenge/07_readme.md +++ b/07_challenge/07_readme.md @@ -0,0 +1,2 @@ +the program should print all integers between 1 and 99 (include both), but the program would exclude 99, +fixed it by changinf nax_num by max_num+1. \ No newline at end of file From c32c560a48e0246e0adbeb0ead7f1fe901a7d00e Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 15:19:37 +0530 Subject: [PATCH 07/10] self argument missing in fizzbuzz def --- 08_challenge/08_challenge.py | 2 +- 08_challenge/08_readme.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/08_challenge/08_challenge.py b/08_challenge/08_challenge.py index a7147d2..71d3ebf 100644 --- a/08_challenge/08_challenge.py +++ b/08_challenge/08_challenge.py @@ -12,7 +12,7 @@ class Fizz_Buzz: "Class to implement FizzBuzz for multiples of 3 and 5" - def fizzbuzz(max_num): + def fizzbuzz(self, max_num): "This method implements FizzBuzz" # adding some redundant declarations on purpose diff --git a/08_challenge/08_readme.md b/08_challenge/08_readme.md index e69de29..5e22510 100644 --- a/08_challenge/08_readme.md +++ b/08_challenge/08_readme.md @@ -0,0 +1 @@ +self argument was missing in fizzbuzz def. \ No newline at end of file From 2aaa4890226d7568fe0d510cd52018568fdb8af0 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 15:34:30 +0530 Subject: [PATCH 08/10] replaced 1 from 6 in the for loop --- 09_challenge/09_challenge.py | 2 +- 09_challenge/09_readme.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/09_challenge/09_challenge.py b/09_challenge/09_challenge.py index 37609a3..19bae03 100644 --- a/09_challenge/09_challenge.py +++ b/09_challenge/09_challenge.py @@ -20,7 +20,7 @@ def fizzbuzz(max_num): num2 = 5 # Google for 'range in python' to see what it does - for i in range(6,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) diff --git a/09_challenge/09_readme.md b/09_challenge/09_readme.md index e69de29..7718a5c 100644 --- a/09_challenge/09_readme.md +++ b/09_challenge/09_readme.md @@ -0,0 +1,3 @@ +the program need to conside integers between 1 and 99 (include both). +but the output was from 6 as the range of the for statement 6 to max_num. +now the 6 has been replaced to 1 and the program is working as per the required output. \ No newline at end of file From dc5e6d8c5f0e4158ed0f9da04568b9e6c523a1ee Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 15:54:26 +0530 Subject: [PATCH 09/10] added 'from fizzbuzz' to imfort so that compiler won't get confused and can execute the function --- 10_challenge/10_challenge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/10_challenge/10_challenge.py b/10_challenge/10_challenge.py index 7d1edf8..1714a60 100644 --- a/10_challenge/10_challenge.py +++ b/10_challenge/10_challenge.py @@ -8,8 +8,8 @@ # print buzz for multiples of 5 # print fizzbuzz for multiples of 3 and 5" """ -import fizzbuzz +from fizzbuzz import fizzbuzz #----START OF SCRIPT if __name__=='__main__': - fizzbuzz(100) \ No newline at end of file + fizzbuzz(100) \ No newline at end of file From fddb02eaf38d36da979c0fb5811446af6ad2b6b9 Mon Sep 17 00:00:00 2001 From: Namitha Doddangadi Sathyananda Date: Fri, 4 Sep 2020 16:44:32 +0530 Subject: [PATCH 10/10] added readme.md file --- 10_challenge/10_readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 10_challenge/10_readme.md diff --git a/10_challenge/10_readme.md b/10_challenge/10_readme.md new file mode 100644 index 0000000..84a2221 --- /dev/null +++ b/10_challenge/10_readme.md @@ -0,0 +1 @@ +replaced import statement. added from fizzbuzz