Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Marvin, your personal bot.")
- print("I hope you are feeling well today.")
- print("OK, let's get started...")
- users_name = input ("What's your name? ")
- print("Welcome " + users_name + "!")
- command = input("What can I do for you? >")
- if command == "add" or command == "plus" or command == "+":
- print("Let's add some numbers!")
- input1 = input("Number 1 > ")
- input2 = input("Number 2 > ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 + number2
- output = str(result)
- print(input1 + " + " + input2 + " = " + output)
- elif command == "subtract" or command == "take away" or command == "-":
- print("Let's subtract some numbers!")
- input1 = input("Number 1 > ")
- input2 = input("Number 2 > ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 - number2
- output = str(result)
- print(input1 + " - " + input2 + " = " + output)
- else:
- print("I'm sorry, I don't understand...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement