Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- operator = input()
- first_num = int(input())
- second_num = int(input())
- def solve(a, b, op):
- if op == 'subtract':
- result = a - b
- elif op == 'add':
- result = a + b
- elif op == 'divide':
- result = a / b
- elif op == 'multiply':
- result = a * b
- return round(result)
- print(solve(first_num, second_num, operator))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement