Question: Hello, I am trying to write a pizza program with Python coding: Instructions: You will write a program to calculate the cost of a pizza.

Hello, I am trying to write a pizza program with Python coding:
Instructions:
You will write a program to calculate the cost of a pizza.
The base cost of a pizza is as follows:
Small (9") $7.00
Medium (12") $10.75
Large (16") $14.75
Toppings are extra and their price depends on the size of pizza. To simplify your program, we only care about how many toppings are on the pizza, not exactly what they are. The cost of the toppings is as follows:
Small $0.50
Medium $1.00
Large $1.50
You can also add extra sauce to any pizza for $0.50.
Finally, there is a sales tax of 4%.
Your program should prompt the user for all the required information and then print out the subtotal, amount of tax, and the total.
Example Output:
How many pizzas would you like? 3
For pizza 1:
What size pizza would you like? (Small, Medium, Large): Small
How many toppings would you like? 5
Would you like extra sauce for $0.50?(Y/N) Y
A Small pizza with 5 toppings and extra sauce is $10
For pizza 2:
What size pizza would you like? (Small, Medium, Large): Medium
How many toppings would you like? 2
Would you like extra sauce for $0.50?(Y/N) N
A Medium pizza with 2 toppings is $12.75
For pizza 3:
What size pizza would you like? (Small, Medium, Large): Large
How many toppings would you like? 3
Would you like extra sauce for $0.50?(Y/N) Y
A Large pizza with 3 toppings and extra sauce is $19.75
Subtotal: $42.5
Tax (4%): $1.7
Total: $44.2
My code so far does not produce an output for 'Bill' variable for some reason.:
amount = input('How many pizzas would you like to order?: ')
pizzaNumber = print('For pizza 1:')
size = input('What size would you like? Small, Medium, Large: ')
toppings = input('How many toppings would you like?: ')
sauce = input('Would you like extra sauce for $.50?(Y/N): ')
Bill =0
if size == 'Small, small, s, S':
Bill +=7.00
elif size == 'Medium, medium, m, M':
Bill +=10.75
elif size == 'Large, large, l, L':
Bill +=14.75
if sauce =='Y, Yes, YES' and size == 'Small, small, s, S':
Bill +=.50
if sauce =='Y, Yes, YES' and size == 'Medium, medium, m, M':
Bill +=.50
if sauce =='Y, Yes, YES' and size == 'Large, large, l, L':
Bill +=.50
if toppings =='1' and size == 'Small, small, s, S':
Bill +=.50
if toppings =='1' and size == 'Medium, medium, m, M':
Bill +=1.00
if toppings =='1' and size == 'Large, large, l, L':
Bill +=1.50
print ('subtotal: $',Bill)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!