Advertisement
HotandCold

Untitled

Dec 6th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #print the Hello Message.
  2. print("Hello I am Marvin the Paranoid Android")
  3. #ask the user to enter their name.
  4. users_name = input("What is your name?")
  5. #print message with users name
  6. print("Welcome " + users_name + ",please enjoy you day on this planet.")
  7. #ask user to enter their command
  8. command = input("How can I help?")
  9. if command == "add" or command == "plus":
  10. input_1 = input("Please type a number -")
  11. input_2 = input("Please type another number -")
  12. number_1 = int(input_1)
  13. number_2 = int(input_2)
  14. results = number_1 + number_2
  15. output = str(results)
  16. print(input_1 +" + "+ input_2 +" = "+ output)
  17. elif command == "subtraction" or command == "minus":
  18. input_1 = input("Please type a number -")
  19. input_2 = input("Please type another number -")
  20. number_1 = int(input_1)
  21. number_2 = int(input_2)
  22. results = number_1 - number_2
  23. output = str(results)
  24. print(input_1 +" - "+ input_2 +" = "+ output)
  25. elif command == "multiply" or command == "times":
  26. input_1 = input("Please type a number -")
  27. input_2 = input("Please type another number -")
  28. number_1 = int(input_1)
  29. number_2 = int(input_2)
  30. results = number_1 * number_2
  31. output = str(results)
  32. print(input_1 +" * "+ input_2 +" = "+ output)
  33. elif command == "division" or command == "divide":
  34. input_1 = input("Please type a number -")
  35. input_2 = input("Please type another number -")
  36. number_1 = int(input_1)
  37. number_2 = int(input_2)
  38. results = number_1 / number_2
  39. output = str(results)
  40. print(input_1 +" / "+ input_2 +" = "+ output)
  41. elif command == "volume of cuboid":
  42. input_1 = input("Enter the width -")
  43. input_2 = input("Enter the height -")
  44. input_3 = input("Enter the depth -")
  45. number_1 = int(input_1)
  46. number_2 = int(input_2)
  47. number_3 = int(input_3)
  48. results = number_1 * number_2 * number_3
  49. output = str(results)
  50. print(input_1 +" * "+ input_2 +" * "+ input_3 +" = "+ output)
  51. else:
  52. print("I do not understand that.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement