Tom_Jung

FutureLearn_MathBot

Jan 8th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. print("Hi, I am R2D2, your personal mathbot")
  2.  
  3. command = input("How may I help you? ")
  4.  
  5. if command == "add" or command == "plus":
  6. print("Let's add some numbers")
  7.  
  8. number1 = int(input("number 1: "))
  9. number2 = int(input("number 2: "))
  10.  
  11. result = number1 + number2
  12.  
  13. print("Results:", number1, "+" ,number2, "=", result)
  14.  
  15. elif command == "subtract" or command == "minus":
  16. print("Let's substract some numbers")
  17.  
  18. number1 = int(input("number 1: "))
  19. number2 = int(input("number 2: "))
  20.  
  21. result = number1 - number2
  22.  
  23. print("Results:", number1, "minus", number2, "=", result)
  24.  
  25. else:
  26. print("Sorry, this is the add math bot")
Add Comment
Please, Sign In to add comment