The print() function - instructions
We've changed the example a bit - we've added one empty print() function invocation. We call it empty because we haven't delivered any arguments to the function.
You can see it in the editor window. Run the code.
What happens?
If everything goes right, you should see something like this:
As you can see, the empty print() invocation is not as empty as you may have expected - it does output an empty line, or (this interpretation is also correct) its output is just a newline.
This is not the only way to produce a newline in the output console. We're now going to show you another way.
The print() function - the escape and newline characters
We've modified the code again. Look at it carefully.
There are two very subtle changes - we've inserted a strange pair of characters inside the rhyme. They look like this: \n.
Interestingly, while you can see two characters, Python sees one.
the backslash (\_ has a very special meaning when used inside strings - this is called the escape character.
The word escape should be understood specifically - it means that the series of characters in the string escapes for the moment (a very short moment) to introduce a special inclusion.
In other words, the backslash doesn't mean anything in itself, but is only a kind of announcement, that the next character after the backslash has a different meaning too.
The letter n placed after the backslash comes from the word newline.
Both the backslash and the n form a special symbol named a newline character, which urges the console to start a new output line
Run the code. Your console should now look like this:
As you can see, two newlines appear in the nursery rhyme, the places where the \n have been used.