print() function

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

print() function

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does print('Hello') display?
A print('Hello')
B Hello
2. Which is correct?
A print('Hi')
B Print('Hi')
3. What does print() display?
A A blank line
B The word 'print'
4. Which quote marks work?
A Both ' and "
B Only "
5. What does print('Welcome') do?
A Waits for input
B Shows: Welcome

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Print('Hi') AOutput: Hello
2print(Hi) BError: Missing quotes
3print('Hi') COutput: (blank)
4print("Hi") DValid: Syntax
5print('Hello') EError: Capital P
6print() FOk: Double quotes

Definitions

print('Hello World')

Fill in the Blanks

Complete each line of code by filling in the missing parts.

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

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A print('Welcome')
B Print('Hello')
C print('Goodbye')
Question 2
A print('Hi')
B print('How are you?')
C print(Bye)
Question 3
A print('First line')
B print 'Second line'
C print('Third line')
Question 4
A print('One')
B print('Two')
C print('Three'
D print('Four')
Question 5
A print('Start')
B print('Middle)
C print('End')

Answer Key

print() function
Section A: Quick Questions
Q1
B — Hello
Q2
A — print('Hi')
Q3
A — A blank line
Q4
A — Both ' and "
Q5
B — Shows: Welcome
Section B: Match the Pairs
Q1
Print('Hi') → Error: Capital P
Q2
print(Hi) → Error: Missing quotes
Q3
print('Hi') → Valid: Syntax
Q4
print("Hi") → Ok: Double quotes
Q5
print('Hello') → Output: Hello
Q6
print() → Output: (blank)
Section C: Definitions
Q1
print('Hello World') — Will display text to console.
Section D: Fill in the Blanks
Q1
print('Hello, world')
Q2
print("Hello, world")
Q3
print('Hello, world')
Q4
print('Hello, world')
Q5
print('Hello, world')
Section E: Spot the Error
Q1
B — Capital P error
Q2
C — Missing quotes
Q3
B — Missing brackets
Q4
C — Missing closing bracket
Q5
B — Mismatched quotes