Commit d7e8996a authored by vipul.v's avatar vipul.v

Delete main.py

parent 51082e4c
class calculator:
def sum(self, x, y):
return x + y
def difference(self, x, y):
return x - y
def multiplication(self, x, y):
return x * y
def division(self, x, y):
return x / y
my_function = calculator()
while True:
print()
print("CHOICE 1: SUM")
print("CHOICE 2: DIFFERENCE")
print("CHOICE 3: MULTIPLICATION")
print("CHOICE 4: DIVISION")
print("CHOICE 5: EXIT")
print()
choice = int(input("Enter a choice: "))
print()
if choice not in [1, 2, 3, 4, 5]:
print("Please, enter a valid Input")
elif choice == 5:
break
else:
x = int(input("Enter first number: "))
y = int(input("Enter second number: "))
if (choice == 1):
print("RESULT -->", x, "+", y, "=", my_function.sum(x, y))
elif (choice == 2):
print("RESULT -->", x, "-", y, "=", my_function.subtraction(x, y))
elif (choice == 3):
print("RESULT -->", x, "*", y, "=", my_function.multiplication(x, y))
elif (choice == 4):
print("RESULT -->", x, "/", y, "=", my_function.division(x, y))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment