Python Output
Learn all about Python Output in this comprehensive tutorial.
- •You have already learned that you can use the print() function to display text or output values:
- •Text in Python must be inside quotes.
- •By default, the print() function ends with a new line.
Print Text
You have already learned that you can use the print() function to display text or output values:
You can use the print() function as many times as you want. Each call prints text on a new line by default:
Double Quotes
Text in Python must be inside quotes. You can use either " double quotes or ' single quotes:
If you forget to put the text inside quotes, Python will give an error:
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:
Note that we add a space after end=" " for better readability.
Module quiz
2 questionsWhich of the following is true about Python Output?
What is the most common pitfall when working with Python Output?
Answer all questions to submit.