bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Python/Foundations
Python•Foundations

Python Output / Print

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Python Output / Print?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___("Hello World!")
3Order

Put the learning moves in the order that makes the concept easiest to apply.

You can use the print() function as many times as you want.
You have already learned that you can use the print() function to display text or output values:
Print Without a New Line

Print Text

You have already learned that you can use the print() function to display text or output values:

Example

print("Hello World!")

You can use the print() function as many times as you want. Each call prints text on a new line by default:

Example

print("Hello World!")

print("I am learning Python.")

print("It is awesome!")

Double Quotes

Text in Python must be inside quotes. You can use either " double quotes or ' single quotes:

Example

print("This will work!")

print('This will also work!')

If you forget to put the text inside quotes, Python will give an error:

Example

print(This will cause an error)

Expected output

SyntaxError: invalid syntax.

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:

Example

print("Hello World!", end=" ")

print("I will print on the same line.")

Note that we add a space after end=" " for better readability.

Previous

Python Statements

Next

Python Output Numbers