Advertisement
Guest User

Dekka

a guest
Jan 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.46 KB | None | 0 0
  1. print("Hi, I'm Dekka, your personal bot assistant.")
  2.  
  3. command = input("How can I help? ")
  4.  
  5. if command == "add" or command == "+":
  6.   print("Let's add some numbers.")
  7.   firstinput = input("Number 1> ")
  8.   secondinput = input("Number 2> ")
  9.   number1 = int(firstinput)
  10.   number2 = int(secondinput)
  11.   result = number1 + number2
  12.   output = str(result)
  13.   print(firstinput + " + " + secondinput + " = " + output)
  14. elif command == "subtract" or command == "-":
  15.   print("Let's subtract some numbers")
  16.   firstinput = input("Number 1> ")
  17.   secondinput = input("Number 2> ")
  18.   number1 = int(firstinput)
  19.   number2 = int(secondinput)
  20.   result = number1 - number2
  21.   output = str(result)
  22.   print(firstinput + " - " + secondinput + " = " + output)
  23. elif command == "multiply" or command == "*":
  24.   print("Let's multiply some numbers")
  25.   firstinput = input("Number 1> ")
  26.   secondinput = input("Number 2> ")
  27.   number1 = int(firstinput)
  28.   number2 = int(secondinput)
  29.   result = number1 * number2
  30.   output = str(result)
  31.   print(firstinput + " - " + secondinput + " = " + output)
  32. elif command == "divide" or command == "/":
  33.   print("Let's divide some numbers")
  34.   firstinput = input("Number 1> ")
  35.   secondinput = input("Number 2> ")
  36.   number1 = int(firstinput)
  37.   number2 = int(secondinput)
  38.   result = number1 / number2
  39.   output = str(result)
  40.   print(firstinput + " - " + secondinput + " = " + output)
  41. else:
  42.   print("I only know addition, subtraction and multiplication, sorry!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement