Advertisement
Mori007

Untitled

May 3rd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. rint("Hi, I am Marvin, your personal bot.")
  2. command = input("How can I help? ")
  3. if command == "add":
  4. print("lets add some numbers")
  5. input1 = input("Number 1> ")
  6. input2 = input("Number 2> ")
  7. number1 = int(input1)
  8. number2 = int(input2)
  9. result = number1 + number2
  10. output = str(result)
  11. print(input1 + " + " + input2 + " = " + output)
  12. elif command == "subtract":
  13. print("lets subtract some numbers")
  14. input1 = input("Number 1> ")
  15. input2 = input("Number 2> ")
  16. number1 = int(input1)
  17. number2 = int(input2)
  18. result = number1 - number2
  19. output = str(result)
  20. print(input1 + " - " + input2 + " = " + output)
  21. elif command == "multiply":
  22. print("lets multiply some numbers")
  23. input1 = input("Number 1> ")
  24. input2 = input("Number 2> ")
  25. number1 = int(input1)
  26. number2 = int(input2)
  27. result = number1 * number2
  28. output = str(result)
  29. print(input1 + " X " + input2 + " = " + output)
  30. elif command == "divide":
  31. print("lets divide some numbers")
  32. input1 = input("Number 1> ")
  33. input2 = input("Number 2> ")
  34. number1 = int(input1)
  35. number2 = int(input2)
  36. result = number1 / number2
  37. output = str(result)
  38. print(input1 + " / " + input2 + " = " + output)
  39. else:
  40. print("sorry I dont understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement