Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calc(x,o,y):
- if o == '+':
- return x + y
- elif o == '-':
- return x - y
- elif o == '*':
- return x * y
- elif o == '/':
- return x / y
- x = int(input())
- o = input()
- y = int(input())
- print(calc(x,o,y))
- print(calc(5,'*',5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement