print() function, online

Six activities your students do on their own devices. See who's finished, and their scores.

print() function in one minute

What students need to know

print() is the function that writes output to the console — usually the first thing anyone learns in Python, since it lets you see what a program is doing. Text (a "string") goes inside parentheses, wrapped in quotes: print('Hello World'). Single and double quotes both work, as long as they match on both ends. Calling print() with nothing prints a blank line.

Mistakes students make

  • Python is case-sensitive, so Print('Hi') (capital P) raises an error — it must be lowercase.
  • Forgetting the quotes around text, or mismatching single and double quotes, is another common slip.
YOU ARE HERE · MODULE 1print() function
NEXT · MODULE 2input() function

Discover other journeys with this module

What students will learn in this module

Every question in Module 1

Quick questions

  1. What does print('Hello') display?Aprint('Hello')BHello
  2. Which is correct?Aprint('Hi')BPrint('Hi')
  3. What does print() display?AA blank lineBThe word 'print'
  4. Which quote marks work?ABoth ' and "BOnly "
  5. What does print('Welcome') do?AWaits for inputBShows: Welcome

Key terms

Students type the meaning of:

  • print('Hello World')

Match the pairs

Print('Hi')Match it to what it does
print(Hi)Match it to what it does
print('Hi')Match it to what it does
print("Hi")Match it to what it does
print('Hello')Match it to what it does
print()Match it to what it does

Fill in the blanks

  1. _____('Hello, world')
  2. print("Hello, world_)
  3. print('Hello, world'_
  4. print__Hello, world')

    Hint: Type: ('

  5. _____('Hello, world__

Spot the error

Question 1

Aprint('Welcome')BPrint('Hello')Cprint('Goodbye')

Question 2

Aprint('Hi')Bprint('How are you?')Cprint(Bye)

Question 3

Aprint('First line')Bprint 'Second line'Cprint('Third line')

Question 4

Aprint('One')Bprint('Two')Cprint('Three'Dprint('Four')

Question 5

Aprint('Start')Bprint('Middle)Cprint('End')