Advertisement
PythoNyashka

Untitled

Dec 1st, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. A = float (input())
  2. B = float (input())
  3. C = str (input())
  4. if C =='+':
  5.     print(A+B)
  6. elif C =='-':
  7.     print(A-B)
  8. elif C =='*':
  9.     print(A*B)
  10. elif C =='/' and B==0:
  11.     print("Деление на 0!")
  12. elif C =='/' and B!=0:
  13.     print(A/B)
  14. elif C =='mod' and B==0:
  15.     print('Деление на 0!')
  16. elif C =='mod' and B!=0:
  17.     print(A%B)
  18. elif C =='pow':
  19.     print(A**B)
  20. elif C =='div' and B==0:
  21.     print('Деление на 0!')
  22. elif C=='div' and B!=0:
  23.     print(A//B)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement