Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- command = raw_input("\nPlease enter a command:\n")
- type(command)
- if command not in ("ADD", "SUB"):
- print ("Illegal command\n")
- else:
- print("Enter "+command+" Expression\n Ex.) 1 2")
- if command == "ADD":
- var1, var2 = [int(x) for x in raw_input("Enter two numbers here: ").split()]
- value = var1+var2
- print(value)
- if command == "SUB":
- var1, var2 = [int(x) for x in raw_input("Enter two numbers here: ").split()]
- value = var1-var2
- print(value)
Add Comment
Please, Sign In to add comment