print("Welcome to Python Pizza Deliveries!") size = input(" What size of pizza do you want? S, M, or L") bill = 0 small_size = 15 medium_size = 20 large_size = 25 if size == "S": bill = small_size elif size == "M": bill = medium_size else: bill = large_size pepperoni = input("Do you want pepperoni? Y or N") if pepperoni == "Y": if size == "S": bill += 2 else: bill += 3 else: bill extra_cheese = input("Do you want extra cheese? Y or N") if extra_cheese == "Y": bill += 1 else: bill print(f"The final bill is ${bill}.")
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter