In this exercise,
the goal is to do some debugging.
We're going to identify what's wrong with the code
and fix it so that it works as expected.
Now the goal is when you hit Run Code
it should print out the example output exactly
as seen in the description pane.
If the description pane is not open
remember you can always click
on that big i button in order to bring it up.
So you might see a certain number of errors
when you hit the Run Code button
without making any changes to the code.
And based on what those errors tell you
or based on your knowledge of the print statement in Python,
you should be able to fix the code
so that it works correctly.
Once the output
in the output pane matches the example output exactly
then you can feel free to hit the Submit button
and check your code.
And once you're done,
or if you get stuck,
remember you can hit the Next buttonâž¡
and I'll run through the solution together with you.
So have a go now.
Let's go through the solution together.
In the first print statement
we're missing a double quote before the word "Day".
That way we can tell the computer
which part of our entire line
is the text that we want printed out.
Now, if those double quotes are not matched,
such as in the error code to begin with,
then the computer doesn't know
which part should be printed out.
By adding that double quote
we fix the first print statement.
In the second print statement,
the problem is that we have only double quotes.
The way that double quotes work
is the computer's going to look
for the first double quote and assume
what's between that and the second double quote
that it sees as the text you want to print.
Now, this is complicated by the fact
that we've got that plus symbol
that we want to show in our print statement.
The fix for this is to alternate the type of quote.
So if we change the outer double quotes,
the one just before the word "String"
and just after the full stop to single quotes
then our entire print statement makes sense to the computer
and it sees that whole text inside the print statement
as one block of text,
and it knows that we want to print out
the double quotes around the plus sign.
In the third print statement,
there is an extra indentation
at the beginning of the line,
and remember that in Python
it's very sensitive to indentation.
It views that as separate from no indentation.
So it's really important
that we keep our code files organized,
and in this case
if you simply just remove that extra indentation
and make that print statement start
at the beginning of the line,
then we can fix this error.
In the final error,
we've got an extra opening parentheses
in the print statement,
and simply by removing it,
it makes our code make sense.
A print statement is comprised of the word "print",
the opening bracket "(" ,
and the closing bracket ")"
and what goes inside that is just the text we want to print.
We can't have any extra symbols or extra code.
As you get along with writing more code,
you'll become more familiar with the format
and the way that code is written.
So don't worry if you got stuck on some of these errors,
it's just the learning process.
And as long as you can go back
and fix your code and understand why it now works
then that's all I want to see.