

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
click for more info
Not enough gems
Cost: 6 gems
1: Variables
incomplete
2: Variables Vary
incomplete
3: Math
incomplete
4: Negative Numbers
incomplete
5: Comments
incomplete
6: Variable Names
incomplete
7: Basic Variable Types
incomplete
8: F-Strings in Python
incomplete
9: NoneType Variables
incomplete
10: NoneType Quiz
incomplete
11: Dynamic Typing
incomplete
12: Math With Strings
incomplete
13: Multi-Variable Declaration
incomplete
14: Boots
incomplete
15: Spellbook
incomplete
16: Character Report
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
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.