Advertisement
xavicano

Untitled

Oct 13th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. # BOT Presentation
  2. print("Hi, I am Marvin, your personal bot.")
  3.  
  4. #input to ask which opetarion you want to do
  5. command = input("How can I help? ")
  6.  
  7. # if operation is add else substract
  8. if command == "add":
  9.     print("lets add some numbers")
  10.     input1 = int(input("Number 1> "))
  11.     input2 = int(input("Number 2> "))
  12.     result = input1 + input2
  13.     #operates with the input and print result
  14.     print(input1," + " ,input2," = " ,result)
  15. elif command == "subtract":
  16.     print("lets subtract some numbers")
  17.     input1 = int(input("Number 1> "))
  18.     input2 = int(input("Number 2> "))
  19.     #operates with the input and print result
  20.     result = input1 - input2
  21.     print(input1," - " ,input2," = " ,result)
  22. else:
  23.     print("sorry I dont understand")
  24.     #print polite error message in case nothing matchs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement