Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ErrorHunter_zuva
Submodule ErrorHunter_zuva added at cfb44e
2 changes: 1 addition & 1 deletion problems/easy/easy_q1.py
Original file line number Diff line number Diff line change
@@ -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))
10 changes: 5 additions & 5 deletions problems/easy/easy_q2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

num1 = int(input("Enter the First Number :"))
num2 = int(input("Enter the Second Number :"))
res = largest_of_two(num1,num1)
print(res)
6 changes: 3 additions & 3 deletions problems/easy/easy_q4.py
Original file line number Diff line number Diff line change
@@ -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 : ")
Expand Down
9 changes: 5 additions & 4 deletions problems/medium/m1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
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")
print("4. Divide")
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:
Expand All @@ -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)