Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Amelia, your personal bot. ")
- print("Let's get started. ")
- users_name = input("What is your name? ")
- # asks user to type in his/her name
- print("Hi," + users_name + ". Welcome. ")
- command = input("How can I help with your maths homework?")
- if command == "add" or command == "plus":
- print("let's add some numbers")
- input1 = input("Number 1> ")
- # user has to type in a number of his wish
- input2 = input("Number 2> ")
- # user has to type in another number
- number1 = int(input1)
- number2 = int(input2)
- result = number1 + number2
- output = str(result)
- print(input1 + "+" + input2 + "=" + output)
- elif command == "subtract" or command == "minus":
- 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)
- elif command == "multiply":
- print("let's multiply 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 == "divide":
- print("let's divide 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("sorry I dont understand")
- print("Have a nice day :3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement