Advertisement
Guest User

Untitled

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