Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- LESSON: 2.1 - Conditionals (If)
- EXERCISE: Pizza Calculator
- """
- #### ---- PIZZA SIZE ---- ####
- total = 0
- size = input("What size pizza do you want? s (small $5), m (medium $7), or l (large $10): ")
- if size == "s":
- total += 5
- #### ---- TOPPINGS ---- ####
- if size == "m":
- total += 7
- if size == "l":
- total += 10
- pep = input("Do you want pepperoni on your pizza? ($1.00) Enter y or n: ")
- if pep == "y":
- total += 1
- mush = input("Do you want mushrooms on your pizza? ($1.00) Enter y or n: ")
- if mush == "y":
- total += 1
- olives = input("Do you want olives on your pizza? ($1.00) Enter y or n: ")
- if olives == "y":
- total += 1
- sausage = input("Do you want sausage on your pizza? ($2.00) Enter y or n: ")
- if sausage == "y":
- total += 2
- bacon = input("Do you want bacon on your pizza? ($2.00) Enter y or n: ")
- if bacon == "y":
- total += 2
- pineapple = input("Do you want pineapple on your pizza? ($3.00) Enter y or n: ")
- if pineapple == "y":
- total += 3
- ranch = input("Do you want ranch dressing as a side? ($.50) Enter y or n: ")
- if ranch == "y":
- total += .50
- coupon = input("Do you have a coupon? Enter y or n: ")
- if coupon == "y":
- price = int(input("How much is your coupon for? "))
- total -= price
- print()
- #### ---- OUTPUT ---- ####
- print("YOUR ORDER")
- print("----------")
- print()
- print("Your pizza will cost " + str(total) + " dollars." + " Thank you for using pizza calculator!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement