Print Text
You have already learned that you can use the print() function to display text or output values:
Print Without a New Line
By default, the print() function ends with a new line.
If you want to print multiple words on the same line, you can use the end parameter:
Python Output Numbers
You can also use the print() function to display numbers:
However, unlike text, we don’t put numbers inside double quotes:
Mix Text and Numbers
You can combine text and numbers in one output by separating them with a comma:
Python Comments
Comments can be used to explain Python code.
Comments can be used to make the code more readable.
Comments can be used to prevent execution when testing code.
Creating a Comment
Comments starts with a #, and Python will ignore them: