Print - Lakelands Computing

Title
Go to content
The Print () Function
The print () function is one of the most useful. It lets you output text to the screen. This text will appear in the output window. Short of creating a Graphical User Interface (with buttons and windows etc - click for theory on GUI ), the print is your best way of telling the user the information you want them to see.

Like all Python functions, print needs to have the two brackets, it is always print() with the thing you want to print inside the brackets.

If you are printing text you will need to tell Python this. To do that you use quotation marks around the text, personally I use double quotes eg "Hello"  but you can use single quotes eg 'Hi'.
If you are printing something else, like the contents of a variable you don't need the quotes (more on that here)

Below is a Python trinket that lets you see the code, run it and see the output. You can also edit the code to see what happens. I have used these throughout this Python section. There is a short video to the right that runs through how to change font size, make the window full screen, run the code etc if you need it.
All Text copyright Lakelands Academy & Mr T Purslow 2020.
All images copyright free / creative commons unless otherwise stated.
You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
Back to content