Printing in Python
To output a message onto the screen use the print command. Then place your message within brackets and speech marks. For example:
When you press F5 (or click the ‘Run’ tab then ‘Run Module’), it will look like this:
Printing over Several Lines
One way of writing over more than one line is to write several print commands like this:
But when we program we always want to make our code the most efficient it can be by using as few lines as possible. Therefore you can write \n within a printed statement to transfer it to the next line.
Both pieces of code display the same thing, but the second one is much more efficient.