Advertisement
ameliacym

Untitled

Aug 21st, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. print("Hi, I am Amelia, your personal bot. ")
  2. print("Let's get started. ")
  3. users_name = input("What is your name? ")
  4. # asks user to type in his/her name
  5. print("Hi," + users_name + ". Welcome. ")
  6.  
  7. command = input("How can I help with your maths homework?")
  8. if command == "add" or command == "plus":
  9. print("let's add some numbers")
  10. input1 = input("Number 1> ")
  11. # user has to type in a number of his wish
  12. input2 = input("Number 2> ")
  13. # user has to type in another number
  14. number1 = int(input1)
  15. number2 = int(input2)
  16. result = number1 + number2
  17. output = str(result)
  18. print(input1 + "+" + input2 + "=" + output)
  19.  
  20. elif command == "subtract" or command == "minus":
  21. print("let's subtract some numbers")
  22. input1 = input("Number 1> ")
  23. input2 = input("Number 2> ")
  24. number1 = int(input1)
  25. number2 = int(input2)
  26. result = number1 - number2
  27. output = str(result)
  28. print(input1 + "-" + input2 + "=" + output)
  29.  
  30. elif command == "multiply":
  31. print("let's multiply 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.  
  40. elif command == "divide":
  41. print("let's divide some numbers")
  42. input1 = input("Number 1> ")
  43. input2 = input("Number 2> ")
  44. number1 = int(input1)
  45. number2 = int(input2)
  46. result = number1 / number2
  47. output = str(result)
  48. print(input1 + "/" + input2 + "=" + output)
  49.  
  50. else:
  51. print("sorry I dont understand")
  52.  
  53. print("Have a nice day :3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement