Advertisement
StanislavP

Untitled

Nov 13th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. a = float(input("Введите первое число: "))
  2. b = float(input("Введите второе число: "))
  3. make = str(input("Что требуется (+, -, *, /): "))
  4.  
  5. if make == "+":
  6. c = a+b
  7. print("Результат" + str(c))
  8.  
  9. elif make == "-":
  10. c = a-b
  11. print("Результат" + str(c))
  12.  
  13. elif make == "*":
  14. c = a*b
  15. print("Результат" + str(c))
  16.  
  17. elif make == "/":
  18. if a == 0 or b == 0:
  19. print("На ноль делить нельзя")
  20. else:
  21. c = a/b
  22. print("Результат" + str(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement