← Python

Comments

A # character starts a comment that Python ignores when running the code

What it does: # This is a comment is valid Python comment syntax. Comments can go after code on the same line with proper spacing. The # makes the whole line a comment — Python skips it entirely. Everything after # is a comment — only the code before it runs. # input() is commented out — only the second input() actually runs. Python uses # for comments — // is used in JavaScript and other languages. # causes Python to ignore everything from that point to the end of the line. Comments are for programmers reading the code — Python ignores them.

Common mistakes: Wrong comment symbol: // should be #. Missing closing quote.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What happens to # print('Hi')?
Prints HiNothing (ignored)
Matches
❌ print('Hi') greeting
Error: Missing #
Applying
Meanings
Term
# This is a comment
Meaning
# is used to explain code - Python ignores text after the #
Practice
print("Name: ")
Testing
Gaps
This gets user's name
Check Answer
Spots
1print('Hello')
2// This is a comment

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Scorpion' badge — Venom Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What happens to # print('Hi')?
A. Prints Hi
B. Nothing (ignored) ✓
The # makes the whole line a comment — Python skips it entirely
2. What displays? print('Hello') # greeting
A. Hello ✓
B. greeting
Everything after # is a comment — only the code before it runs
3. What does # do?
A. Prints # symbol
B. Makes text a comment ✓
# starts a comment — Python ignores everything from # to the end of the line
4. Which line runs? # input() vs input()
A. Second line only ✓
B. Both lines
# input() is commented out — only the second input() actually runs
5. What displays? # 'Test'
A. Nothing ✓
B. Test
The # turns the whole line into a comment — nothing runs

Match the Pairs

print('Hi') greeting Error: Missing #
// This is a comment Invalid: Use # not //
# This is a comment Valid: Comment
print('Hi') # greeting Ok: End-of-line comment
# print('Hi') Output: (nothing)
print('World') # test Output: World

Key Term

# This is a comment
# is used to explain code - Python ignores text after the #

Fill in the Blanks

1. # This gets user's name input('Name: ')
2. print('Hello') # greeting message
3. # Get student details input('Age: ')
4. #Start Program print('Press Enter')
5. # This is a comment print('Test')

Spot the Error

Question 1
A print('Hello')
B // This is a comment
C input()
Line B — Wrong comment symbol: // should be #
Question 2
A # Get user name
B input('Name: ')
C print('Age: )
Line C — Missing closing quote
Question 3
A print('Hi')
B # input('Name: ')
C print 'Done'
Line C — Missing parentheses on print
Question 4
A # Student form
B print('Name: ')
C -- This is commented
D input()
Line C — Wrong comment symbol: -- should be #
Question 5
A print('Start')
B input('Data: ') // end-of-line
C print('End')
Line B — Wrong comment symbol: // should be #
For Teachers

Create a free class, add this module to a journey, and track who's stuck.

Create a free teacher account →

No credit card. No setup fee. Make a class and invite students in under three minutes.

For Students

Practice this topic interactively, track progress, and unlock badges.

Start Learning Free →

Have a class code?