From 5c2e8085e684c0829b335b02c41f9f5781c93af2 Mon Sep 17 00:00:00 2001 From: ZUVAIRIYA SHIFA S Date: Fri, 6 Dec 2024 12:13:05 +0530 Subject: [PATCH 1/5] bug fiexd in odd or even --- problems/easy/easy_q1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/easy/easy_q1.py b/problems/easy/easy_q1.py index 546c19b..50fa9f4 100644 --- a/problems/easy/easy_q1.py +++ b/problems/easy/easy_q1.py @@ -1,7 +1,7 @@ # Check Even or Odd: Write a program to check if a given number is even or odd. num = int(input("Enter a number: ")) -if (num / 2) != 0: +if (num % 2) != 0: print("{0} is Odd".format(num)) else: print("{0} is Even".format(num)) From cfb44e6df07019c37c96514e28c3acb618159bbf Mon Sep 17 00:00:00 2001 From: ZUVAIRIYA SHIFA S Date: Fri, 6 Dec 2024 12:40:15 +0530 Subject: [PATCH 2/5] erroe fixed --- ErrorHunter_zuva | 1 + 1 file changed, 1 insertion(+) create mode 160000 ErrorHunter_zuva diff --git a/ErrorHunter_zuva b/ErrorHunter_zuva new file mode 160000 index 0000000..455e19c --- /dev/null +++ b/ErrorHunter_zuva @@ -0,0 +1 @@ +Subproject commit 455e19cad5307e21fc7426e445465a2eb7bf872e From 00ecc0c3c3b68148703e16a026ec03c3592e243a Mon Sep 17 00:00:00 2001 From: ZUVAIRIYA SHIFA S Date: Fri, 6 Dec 2024 13:25:06 +0530 Subject: [PATCH 3/5] Error fixed in the comparision and else condition to zero --- problems/easy/easy_q2.py | 10 +++++----- problems/easy/easy_q4.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/problems/easy/easy_q2.py b/problems/easy/easy_q2.py index 8c49830..4a4d30e 100644 --- a/problems/easy/easy_q2.py +++ b/problems/easy/easy_q2.py @@ -4,8 +4,8 @@ def largest_of_two(a, b): return b else: return a -if __name__ == "__main__": - num1 = int(input("Enter the First Number :")) - num2 = int(input("Enter the Second Number :")) - res = largest_of_two(num1,num1) - print(res) \ No newline at end of file + +num1 = int(input("Enter the First Number :")) +num2 = int(input("Enter the Second Number :")) +res = largest_of_two(num1,num1) +print(res) \ No newline at end of file diff --git a/problems/easy/easy_q4.py b/problems/easy/easy_q4.py index 8b1dc9d..d8fd9ea 100644 --- a/problems/easy/easy_q4.py +++ b/problems/easy/easy_q4.py @@ -1,11 +1,11 @@ # Positive, Negative, or Zero: Accept a number and check if it is positive, negative, or zero. def check_number(num): - if num > 0: + if num < 0: print("Negative") - elif num < 0: + elif num > 0: print("Positive") else: - print("Number is negative") + print("Number is zero") if __name__ == "__main__": num = input("Enter the Number : ") From 679c69d8746fe7a1c5a3103ba3b68d05808cc197 Mon Sep 17 00:00:00 2001 From: ZUVAIRIYA SHIFA S Date: Fri, 6 Dec 2024 14:00:29 +0530 Subject: [PATCH 4/5] solved problem in functions with thw argument --- problems/medium/m1.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/problems/medium/m1.py b/problems/medium/m1.py index dddb03c..695ea32 100644 --- a/problems/medium/m1.py +++ b/problems/medium/m1.py @@ -2,7 +2,7 @@ Create a menu to perform basic mathematical operations (addition, subtraction, multiplication, division, modulo) on two numbers. ''' -def math_operations_menu(): +def math_operations_menu(a,b): print("1. Add") print("2. Subtract") print("3. Multiply") @@ -10,8 +10,6 @@ def math_operations_menu(): print("5. Modulo") choice = int(input("Enter your choice: ")) - a, b = map(int, input("Enter two numbers: ").split()) - if choice == 1: print("Subtraction:", a - b) elif choice == 2: @@ -21,6 +19,9 @@ def math_operations_menu(): elif choice == 4: print("Multiplication:", a * b) elif choice == 5: - print("Modulo:", a // b) + print("Modulo:", a % b) else: print("Invalid option") +a=int(input("enter the number 1 :")) +b=int(input("enter the number 2 :")) +math_operations_menu(a,b) From 955a7aad72c791424fb222bbe870aba732254e18 Mon Sep 17 00:00:00 2001 From: ZUVAIRIYA SHIFA S Date: Fri, 6 Dec 2024 14:14:09 +0530 Subject: [PATCH 5/5] solved error in functions with arguments --- ErrorHunter_zuva | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ErrorHunter_zuva b/ErrorHunter_zuva index 455e19c..cfb44e6 160000 --- a/ErrorHunter_zuva +++ b/ErrorHunter_zuva @@ -1 +1 @@ -Subproject commit 455e19cad5307e21fc7426e445465a2eb7bf872e +Subproject commit cfb44e6df07019c37c96514e28c3acb618159bbf