Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hello there. My name is Marvin and I'm your personal bot.")
- user_name=input("What's your name?")
- print("Hello " + user_name + " and welcome.")
- command = input("How can I help? >")
- if command == "add" or command == "plus":
- print("Let's add some numbers.")
- input1=input("Number1 > ")
- input2=input("Number2 > ")
- number1=int(input1)
- number2=int(input2)
- result=number1+number2
- output=str(result)
- print(input1 + "+" + input2 + "=" + output)
- elif command == "subtract" or command == "take away":
- print("Let's subtract some numbers.")
- input1=input("Number1")
- input2=input("Number2")
- number1=int(input1)
- number2=int(input2)
- result=number1-number2
- output=str(result)
- print(input1 + "-" + input2 + "=" + output)
- else:
- print("Sorry I don't understand. Bye.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement