print() function, online
Six activities your students do on their own devices. See who's finished, and their scores.
Learning
Understanding
Testing
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
What students will learn in this module
Every question in Module 1
Quick questions
- What does
print('Hello')display?Aprint('Hello')BHello - Which is correct?Aprint('Hi')BPrint('Hi')
- What does
print()display?AA blank lineBThe word 'print' - Which quote marks work?ABoth ' and "BOnly "
- 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 doesprint(Hi)Match it to what it doesprint('Hi')Match it to what it doesprint("Hi")Match it to what it doesprint('Hello')Match it to what it doesprint()Match it to what it doesFill in the blanks
_____('Hello, world')print("Hello, world_)print('Hello, world'_print__Hello, world')
Hint: Type: ('
_____('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')
