Python 7
Python 7
return x + y
return x - y
return x * y
return x / y
print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
while True:
# take input from the user
try:
except ValueError:
continue
if choice == '1':
if next_calculation == "no":
break
else:
print("Invalid Input")
Output;