diff --git a/ErrorHunter_zuva b/ErrorHunter_zuva new file mode 160000 index 0000000..cfb44e6 --- /dev/null +++ b/ErrorHunter_zuva @@ -0,0 +1 @@ +Subproject commit cfb44e6df07019c37c96514e28c3acb618159bbf 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)) 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 : ") 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)