Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num1 = float(input("Please enter the first number: "))
- operation = int(input("Do you want to: \n 1) Add; 2) Subtract; 3) Multiply; 4) Divide: "))
- num2 = float(input("Please enter the final number: "))
- if operation == 1:
- result = num1 + num2
- elif operation == 2:
- result = num1 - num2
- elif operation == 3:
- result = num1 * num2
- elif operation == 4:
- result = num1 / num2
- print(f'The result is {result}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement