option = int(input("Enter Your Choice 1(Add)/2(Sub)/3(Divide)/4(Multiply): "))
# Check if the option is a valid operation
if option > 4:
print("enter a valid Number")
exit()
# Get the 2 numbers which will be calculating on
num1 = int(input("Enter Number 1: "))
num2 = int(input("Enter Number 2: "))
if option == 1:
print("The Sum Is ", num1 + num2)
elif option == 2:
print("The Difference Is ", num1 - num2)
elif option == 3:
print("The Division Is ", num1 / num2)
elif option == 4:
print("The Product Is ", num1 * num2)
elif option == 5:
print("The Power Is ", num1 ** num2)
import time
times = 3
for x in range (times):
def calculate(a, b, formula):
if formula == '+':
return a + b
elif formula == '-':
return a - b
elif formula == '*':
return a * b
elif formula == '/':
return a / b
else:
print('Just Leave!')
return 'Closing program...'
print('Choose a number')
a = float(input())
print('Choose a second number')
b = float(input())
print('Do you want to * / - or + ?')
formula = input()
answer = calculate(a, b, formula)
print(answer)
sleep(3)