Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I'm Dekka, your personal bot assistant.")
- command = input("How can I help? ")
- if command == "add" or command == "+":
- print("Let's add some numbers.")
- firstinput = input("Number 1> ")
- secondinput = input("Number 2> ")
- number1 = int(firstinput)
- number2 = int(secondinput)
- result = number1 + number2
- output = str(result)
- print(firstinput + " + " + secondinput + " = " + output)
- elif command == "subtract" or command == "-":
- print("Let's subtract some numbers")
- firstinput = input("Number 1> ")
- secondinput = input("Number 2> ")
- number1 = int(firstinput)
- number2 = int(secondinput)
- result = number1 - number2
- output = str(result)
- print(firstinput + " - " + secondinput + " = " + output)
- elif command == "multiply" or command == "*":
- print("Let's multiply some numbers")
- firstinput = input("Number 1> ")
- secondinput = input("Number 2> ")
- number1 = int(firstinput)
- number2 = int(secondinput)
- result = number1 * number2
- output = str(result)
- print(firstinput + " - " + secondinput + " = " + output)
- elif command == "divide" or command == "/":
- print("Let's divide some numbers")
- firstinput = input("Number 1> ")
- secondinput = input("Number 2> ")
- number1 = int(firstinput)
- number2 = int(secondinput)
- result = number1 / number2
- output = str(result)
- print(firstinput + " - " + secondinput + " = " + output)
- else:
- print("I only know addition, subtraction and multiplication, sorry!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement