Advertisement
Guest User

F

a guest
Feb 23rd, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. func = str(input("Operation? [+; -; *; /]: "))
  2. a = int(input("First variable: "))
  3. b = int(input("Second variable: "))
  4.  
  5. if func == "+":
  6.     c = a + b
  7.     print(c)
  8.  
  9. elif func == "-":
  10.     c = a - b
  11.     print(c)
  12.  
  13. elif func == func == "*":
  14.     c = a * b
  15.     print(c)
  16.  
  17. elif func == "/":
  18.     c = a / b
  19.     print(c)
  20. input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement