Advertisement
ykcr

botsub

Oct 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. print("Hi, I am Rosie, your personal bot.")
  2.  
  3. command = input("How can I help? ")
  4.  
  5. if command == "add":
  6.   print("lets add some numbers")
  7.   input1 = input("Number 1> ")
  8.   input2 = input("Number 2> ")
  9.   number1 = int(input1)
  10.   number2 = int(input2)
  11.   result = number1 + number2
  12.   output = str(result)
  13.   print(input1 + " plus " + input2 + " = " + output)
  14.  
  15. elif command == "subtract":
  16.   print("lets subtract some numbers")
  17.   input3 = input("Number 3> ")
  18.   input4 = input("Number 4> ")
  19.   number3 = int(input3)
  20.   number4 = int(input4)
  21.   result = number3 - number4
  22.   output = str(result)
  23.   print(input3 + " minus " + input4 + " = " + output)
  24.  
  25. else:
  26.   print("Sorry, I don't understand")
  27. print("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement