0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Comments don't do... anything. They are ignored by the Python interpreter. That said, they're good for what the name implies: adding comments to your code in plain English (or whatever language you speak).
A single #
makes the rest of the line a comment:
# speed describes how fast the player
# moves in meters per second
speed = 2
You can use triple quotes to start and end multi-line comments as well:
"""
the code found below
will print 'Hello, World!' to the console
"""
print("Hello, World!")
This is useful if you don't want to add the #
to the start of each line when writing paragraphs of comments.
Line #1 in the code was meant to be a comment, but the developer forgot to use the correct syntax (#
).
Fix the bug by commenting out the first line of code.
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution