fork download
  1. a = float(input())
  2. x = input()
  3. b = float(input())
  4. if x == "+" :
  5. print(a+b)
  6. elif x == "-" :
  7. print(a-b)
  8. elif x == "*" :
  9. print(a*b)
  10. elif x == "/" :
  11. if b == "0" :
  12. print("error")
  13. else :
  14. print(a/b)
  15. elif x == "//" :
  16. if b == "0" :
  17. print("error")
  18. else :
  19. print(a//b)
  20. elif x == "%" :
  21. if b == "0" :
  22. print("error")
  23. else :
  24. print(a%b)
  25. elif x == "**" :
  26. if a == "0" and b == "0" :
  27. print("error")
  28. else:
  29. print(a**b)
  30.  
Success #stdin #stdout 0.07s 14104KB
stdin
10
+
0
stdout
10.0