Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. print("Hello, I'm Lucy. I'm your personal maths bot.")
  2. users_name=input("What's your name? ")
  3. if users_name=="Lucy" or users_name==("lucy"):
  4. print("Wow! Just like me.")
  5. print("Hello "+users_name+", and welcome!")
  6. print("Let's make a start.")
  7. input_1=input("Give me a number. ")
  8. print("Ooh, that's one of my favourites! ")
  9. input_2=input("Give me another number. ")
  10. print("What would you like me to do with these numbers?")
  11. action_1=input("I can add, subtract, divide or multiply >")
  12. num_1=int(input_1)
  13. num_2=int(input_2)
  14. if action_1=="add" or action_1=="ADD" or action_1=="Add" or action_1=="+":
  15. print("The total is "+(input_1+input_2))
  16. print("No wait. That's not right.")
  17. sum_1=num_1+num_2
  18. print(sum_1)
  19. print("That's better.")
  20. result=str(sum_1)
  21. print(input_1 + " + " +input_2 + " = " + result)
  22. print("I'm pretty sure that's right.")
  23. print("I hope that's been useful for you, "+ users_name)
  24. elif action_1=="multiply" or action_1=="MULTIPLY" or action_1=="Multiply" or action_1=="*":
  25. sum_2=num_1*num_2
  26. result_2=str(sum_2)
  27. sum_3=(num_1*num_2)+1234567
  28. result_3=str(sum_3)
  29. print("If I multiply them together, it's "+result_2)
  30. print("If I multiply them together and add 1234567 it's "+result_3)
  31. if sum_3>1234999 and sum_3<2000000:
  32. print("That's a really big number. I'm tired now.")
  33. elif sum_3>1999999:
  34. print("That's huge! Don't make me do that again.")
  35. else:
  36. print("Phew. That one wasn't too tricky.")
  37. print("I hope that's been useful for you, "+ users_name)
  38. elif action_1=="subtract" or action_1=="SUBTRACT" or action_1=="Subtract" or action_1=="-":
  39. sum_4=(num_1-num_2)
  40. result_4=str(sum_4)
  41. print(input_1 + "-" + input_2 + "=" + result_4)
  42. print("I hope that's been useful for you, "+ users_name)
  43. elif action_1=="divide" or action_1=="DIVIDE" or action_1=="Divide" or action_1=="/":
  44.  
  45. print("Do I have to? Division is tricky.")
  46. confirm_1=input("Type yes or no >")
  47. if confirm_1=="yes or no":
  48. print("Ha ha. Very funny.")
  49. elif confirm_1=="no":
  50. print("Great! Thank you.")
  51. elif confirm_1=="yes":
  52. sum_5=float(num_1)/float(num_2)
  53. result_5=str(sum_5)
  54. print("Okay then, if I must.")
  55. print(input_1 + " divided by " + input_2 +" = " +result_5)
  56. print("I hope that's been useful for you, "+ users_name)
  57. print("I'm confused. I don't know what that means.")
  58. else:
  59. print("I'm confused. I don't know what that means.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement