Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. print('calculator')
  2. while True:
  3. N=int(input())
  4. Op=input() #действие (+, -, *, //)
  5. M=int(input ())
  6. if Op == '+':
  7. print(N+M)
  8. elif Op == '-':
  9. print(N-M)
  10. elif Op == '*':
  11. print(N*M)
  12. elif Op == '//':
  13. if M!=0:
  14. print(N/M)
  15. else:
  16. print('Error')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement