Guest User

Untitled

a guest
Nov 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. while True:
  2. command = raw_input("\nPlease enter a command:\n")
  3. type(command)
  4. if command not in ("ADD", "SUB"):
  5. print ("Illegal command\n")
  6. else:
  7. print("Enter "+command+" Expression\n Ex.) 1 2")
  8. if command == "ADD":
  9. var1, var2 = [int(x) for x in raw_input("Enter two numbers here: ").split()]
  10. value = var1+var2
  11. print(value)
  12. if command == "SUB":
  13. var1, var2 = [int(x) for x in raw_input("Enter two numbers here: ").split()]
  14. value = var1-var2
  15. print(value)
Add Comment
Please, Sign In to add comment