All right, congratulations!
You've got yourself a job at Python Pizza.
So your first job as a programmer at Python Pizza
is to build an automatic Pizza Order Program.
That is the goal of this exercise.
Take a look at the starting code.
You'll see that the user can put in the size that they want,
whether if they want to add pepperoni
and whether if they want extra cheese.
Based on the user input for these three criteria,
we're going to work out what is the price of their pizza.
If you look inside the description box
you'll see the different modifiers.
Starting with the size, we have different prices
for small, medium, and large.
And then if somebody wants to add pepperoni
that's an extra $2 to a small pizza,
$3 for a medium or large pizza.
And finally, if you want to add extra cheese for any pizza
that's just a single extra dollar.
If you take a look at the example input
where we've got a large pizza
where they want "Yes" to pepperoni and "No" to extra cheese,
then the example output is as follows.
"Thank you for choosing Python Pizza Deliveries!
"Your final bill is: $28."
Now remember, the first line of that output
is already printed for you in line 1,
so you don't need to worry about that.
All you need to figure out is how to build the program
so that it prints out, "Your final bill is",
and then calculates the correct value
based on the user input.
And the user input is just going to be a bunch of letters.
So the first input is going to come in for the size,
S, M or L.
The second one is going to be Y or N,
and the third one is also going be Y or N.
Pause, have a think about this,
apply your knowledge of conditionals,
and see if you can complete this exercise.
Alright, so the first thing we're going to do
is we're going to create a variable called "bill"
to keep track of the ongoing price of their pizza.
We can start that bill at $0 and then we can proceed.
The next part of our code checks for the first condition,
which is whether if their first input was S, M, or L,
and we can use an if, elif, else,
or we can use three if statements.
You can do it in many ways,
but essentially we're checking to see
if they put an input of S,
then we're going to add $15 to the bill.
If they put an input of M on the first line,
then we're going to add 20.
And if the last condition, or we want to check if it was L,
then we can add $25.
Now the next condition is whether if they wanted pepperoni
on their pizza,
and if the answer is yes,
then we have to check against the size that they ordered.
If the size was medium or large,
we're going to add $3 to their bill,
and if it was small, then we're going to add only $2.
So you could have used a combination.
So you could have said if size == "M"
and size == "L",
but in this case, what I've done is simply checked
for just the single statement, which is unique.
If the size is small, then add two.
In all other conditions, add three.
Final condition is probably the easiest.
We simply want to check is the last input is "Yes"
in this case, we just add $1 to the bill.
And all of these things added up
will eventually create the final price for the pizza.
And we can print out that final price using an f-string
by inserting the bill into the print statement,
and make sure that you've got all your punctuation,
your full stops, everything matching exactly what it says
in the description,
otherwise, the tests won't pass.
But otherwise, all going well,
you should be able to submit your code solution
and it should show as passed for all conditions.