Advertisement
martingr

pizza calculator

Aug 22nd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. """
  2. LESSON: 2.1 - Conditionals (If)
  3. EXERCISE: Pizza Calculator
  4. """
  5.  
  6. #### ---- PIZZA SIZE ---- ####
  7.  
  8. total = 0
  9.  
  10. size = input("What size pizza do you want? s (small $5), m (medium $7), or l (large $10): ")
  11. if size == "s":
  12. total += 5
  13.  
  14. #### ---- TOPPINGS ---- ####
  15.  
  16. if size == "m":
  17. total += 7
  18.  
  19. if size == "l":
  20. total += 10
  21.  
  22. pep = input("Do you want pepperoni on your pizza? ($1.00) Enter y or n: ")
  23. if pep == "y":
  24. total += 1
  25.  
  26. mush = input("Do you want mushrooms on your pizza? ($1.00) Enter y or n: ")
  27. if mush == "y":
  28. total += 1
  29.  
  30. olives = input("Do you want olives on your pizza? ($1.00) Enter y or n: ")
  31. if olives == "y":
  32. total += 1
  33.  
  34. sausage = input("Do you want sausage on your pizza? ($2.00) Enter y or n: ")
  35. if sausage == "y":
  36. total += 2
  37.  
  38. bacon = input("Do you want bacon on your pizza? ($2.00) Enter y or n: ")
  39. if bacon == "y":
  40. total += 2
  41.  
  42. pineapple = input("Do you want pineapple on your pizza? ($3.00) Enter y or n: ")
  43. if pineapple == "y":
  44. total += 3
  45.  
  46. ranch = input("Do you want ranch dressing as a side? ($.50) Enter y or n: ")
  47. if ranch == "y":
  48. total += .50
  49.  
  50. coupon = input("Do you have a coupon? Enter y or n: ")
  51. if coupon == "y":
  52. price = int(input("How much is your coupon for? "))
  53.  
  54. total -= price
  55. print()
  56.  
  57. #### ---- OUTPUT ---- ####
  58.  
  59. print("YOUR ORDER")
  60. print("----------")
  61. print()
  62. print("Your pizza will cost " + str(total) + " dollars." + " Thank you for using pizza calculator!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement