Advertisement
AnonumysMR

Калькулятор на консоль

Jun 22nd, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #Standartcode на консоль
  2.  
  3. what = input( "Что делаем (+, -, *, :, ): " )
  4.  
  5. a = float( input("Вести первое число:  "))
  6. b = float( input("Вести второе число:  "))
  7.  
  8. if what == "+":
  9.     c = a + b
  10.     print("Ответ: " + str(c))
  11. elif what == "-":
  12.     c = a - b
  13.     print("Ответ: " + str(c))
  14. elif what == "*":
  15.     c = a * b
  16.     print("Ответ: " + str(c))
  17. elif what == ":":
  18.     c = a / b
  19.     print("Ответ: " + str(c))
  20. elif what == "//":
  21.     c = a // b
  22.     print("Ответ: " + str(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement