Advertisement
xavicano

Untitled

Oct 13th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 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. input1 = int(input("Number 1> "))
  7. input2 = int(input("Number 2> "))
  8. # if operation is add else substract
  9. if command == "add":
  10.     print("lets add some numbers")
  11.     result = input1 + input2
  12.     #operates with the input and print result
  13.     print(input1," + " ,input2," = " ,result)
  14. elif command == "subtract":
  15.     print("lets subtract some numbers")
  16.     #operates with the input and print result
  17.     result = input1 - input2
  18.     print(input1," - " ,input2," = " ,result)
  19. elif command == "multiply":
  20.     print("lets subtract some numbers")
  21.     #operates with the input and print result
  22.     result = input1 * input2
  23.     print(input1," * " ,input2," = " ,result)
  24. elif command == "divide":
  25.     print("lets subtract some numbers")
  26.     #operates with the input and print result
  27.     result = input1 / input2
  28.     print(input1," / " ,input2," = " ,result)
  29. else:
  30.     print("sorry I dont understand")
  31.     #print polite error message in case nothing matchs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement