Advertisement
ammaokeke

Untitled

Feb 19th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #introduce yourself as their personal bot
  2. print("Hi I am Amma, your personal bot.")
  3. command =input("How canI help?")
  4. # choose acommand to add
  5. if command =="add":
  6. print("let's 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 +" + " + input2 + " = " +output)
  14. elif command =="subtract":
  15. print("Let's subtract some numbers")
  16. input1 = input("Number 1> ")
  17. input2 = input("Number 2> ")
  18. number1 =int(input1)
  19. number2 =int(input2)
  20. result = number1 - number2
  21. output = str (result)
  22. print(input1 +" - " + input2 + " = " +output)
  23. # choose a command to multiply
  24. elif command =="multiply":
  25. print("Let's multiply some numbers")
  26. input1 = input("Number 1> ")
  27. input2 = input("Number 2> ")
  28. number1 =int(input1)
  29. number2 =int(input2)
  30. result = number1 * number2
  31. output = str (result)
  32. print(input1 +" * " +input2 + " = " +output)
  33. #choose a command to divide
  34. elif command =="divide":
  35. print("Let's divide some numbers")
  36. input1 = input("Number 1> ")
  37. input2 = input("Number 2> ")
  38. number1 =int(input1)
  39. number2 =int(input2)
  40. result = number1 / number2
  41. output = str (result)
  42. print(input1 +" / " + input2 + " = " +output)
  43. #if neithe add or subtract is chosen the message "I don't understand will be displayed
  44. else:
  45. print("sorry, I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement