Advertisement
PonaFly

Untitled

Oct 7th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. a=float(input())
  2. b=float(input())
  3. c=input()
  4.  
  5. if (c== '+'):
  6.     print(a+b)
  7. elif(c=='-'):
  8.     print(a-b)
  9. elif (c=='/'):
  10.      if (b==0):
  11.         print('Деление на 0!')
  12.      else:
  13.         print(a/b)
  14. elif (c=="*"):
  15.     print(a*b)
  16. elif (c=='mod'):
  17.     if (b == 0):
  18.         print('Деление на 0!')
  19.     else:
  20.        print(a%b)
  21. elif (c=='div'):
  22.     if (b == 0):
  23.         print('Деление на 0!')
  24.     else:
  25.          print(a//b)
  26. elif (c=='pow'):
  27.     print(a**b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement