PythonPI LAB
2.1.1.6 LAB: The print() function
MODULE (10%)
SECTION (33%)
Score: 0 / 14

Estimated time

5-10 minutes

Level of difficulty

Very easy

Objectives

Scenario

The print() command simply prints a line to the screen. Complete the 5 tasks below in order.

Expected output or result

Hello, Python!
🎉 Lab complete! 14 / 14 points — Download your report above.

Tasks

Task 1 — Print Hello, Python! with double quotes
What to do: On the first available code line, print Hello, Python! using print() with double quotes.
3 pts
Task 2 — Print your first name
What to do: Press Enter after the Task 1 statement, then on the next line use print() to display your first name.
3 pts
Task 3 — Trigger a NameError by removing quotes
What to do: On the existing first-name line, remove the quotes from inside print() to cause a NameError; do not add another line.
2 pts
Task 4 — Trigger a SyntaxError by removing parentheses
What to do: On the current line, type print "Hello" without parentheses to cause a SyntaxError; do not add another line.
2 pts
Task 5 — Use single quotes and two print() statements
What to do: Replace the current code with two lines: type one print() statement, press Enter, then type the second print() statement on the next line; use single quotes in at least one.
4 pts
main.py
1
Console
Ready. Click Run to execute your code.
AI Tutor
Powered by Claude
AI
Welcome! Loading...
What does print() do?
Why quotes?
SyntaxError?
NameError?
Single vs double quotes