Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def calc(x,o,y):
  2. if o == '+':
  3. return x + y
  4. elif o == '-':
  5. return x - y
  6. elif o == '*':
  7. return x * y
  8. elif o == '/':
  9. return x / y
  10.  
  11.  
  12. x = int(input())
  13. o = input()
  14. y = int(input())
  15.  
  16. print(calc(x,o,y))
  17. print(calc(5,'*',5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement