Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #print the Hello Message.
- print("Hello I am Marvin the Paranoid Android")
- #ask the user to enter their name.
- users_name = input("What is your name?")
- #print message with users name
- print("Welcome " + users_name + ",please enjoy you day on this planet.")
- #ask user to enter their command
- command = input("How can I help?")
- if command == "add" or command == "plus":
- input_1 = input("Please type a number -")
- input_2 = input("Please type another number -")
- number_1 = int(input_1)
- number_2 = int(input_2)
- results = number_1 + number_2
- output = str(results)
- print(input_1 +" + "+ input_2 +" = "+ output)
- elif command == "subtraction" or command == "minus":
- input_1 = input("Please type a number -")
- input_2 = input("Please type another number -")
- number_1 = int(input_1)
- number_2 = int(input_2)
- results = number_1 - number_2
- output = str(results)
- print(input_1 +" - "+ input_2 +" = "+ output)
- elif command == "multiplication" or command == "times":
- input_1 = input("Please type a number -")
- input_2 = input("Please type another number -")
- number_1 = int(input_1)
- number_2 = int(input_2)
- results = number_1 * number_2
- output = str(results)
- print(input_1 +" * "+ input_2 +" = "+ output)
- elif command == "division" or command == "divide":
- input_1 = input("Please type a number -")
- input_2 = input("Please type another number -")
- number_1 = int(input_1)
- number_2 = int(input_2)
- results = number_1 / number_2
- output = str(results)
- print(input_1 +" / "+ input_2 +" = "+ output)
- else:
- print("I do not understand that.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement