The print() function- instructions
You have already seen a computer program that contains one function invocation. A function invocation is one of many possible kinds of Python instructions.
Of course, any complex program usually contains many more instructions than one. The question is: how do you couple more than one instruction into the Python code?
Python's syntax is quite specific in this area. Unlike most programming languages, Python requires that there cannot be more than one instruction in a line.
A line can be empty (i.e., it may contain no instruction at all) but it must not contain two, three or more instructions. This is strictly prohibited.
Note: Python makes one exception to this rule - it allows one instruction to spread across more than one line )which may be helpful when your code contains complex constructions).
Let's expand the code a bit, you can see it in the editor. Run it and note what you see in the console.
Your Python console should now look like this:
This is a good opportunity to make some observations:
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.