daily pastebin goal
6%
SHARE
TWEET

botsub

ykcr Oct 20th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top