#Assignment Calculator
prompt = "Enter number "
num1 = int(input(prompt))
prompt = "To DO? '+','-','*','/' "
todo = input(prompt)
prompt = "Enter number again "
num2 = int(input(prompt))
if todo == '+':
print(num1+num2)
elif todo == '-':
print(num1-num2)
elif todo == '*':
print(num1*num2)
elif todo == '/':
print(num1/num2)
Enter number 16
To DO? '+','-','*','/' -
Enter number again 8
Result: 8
No comments:
Post a Comment