Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Greetings! I am Samwise, your personal Bot.")
- command = input("How can I assist? ")
- if command == "add":
- print("lets 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 + " plus " + input2 + " = " + output)
- elif command == "subtract":
- print("lets 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 == "divide":
- print("Lets divide some numbers ")
- input1 = input("Number 1>")
- input2 = input("Number 2>")
- input3 = input("Number 3>")
- number1 = int(input1)
- number2 = int(input2)
- number3 = int(input3)
- print("now add in some multiplication")
- result = number1 / number2 * number3
- output = str(result)
- print(input1 + " divided by " + input2 + " times " + input3 + " = " + output)
- else:
- print("Would you like some tea instead?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement