🧩Comment
Also known as Code Comment
A note in the code for people. The computer skips it.
Think of it like
Think of it like a sticky note on a recipe. The cook reads it, but it is not a step.
Example
Lucy writes # prices include tax above one line. Next year a new teammate reads it and does not add the tax twice.
Why it matters
Code is read far more often than it is written. A short note saves the next reader an hour of guessing.
Definition
Example code
python
# Prices already include 20% tax
total = price * quantityCommon mistake
Key takeaways
- 1For people. The computer skips every comment.
- 2Say why. The code already shows what it does.
- 3Keep it true. An old, wrong comment is worse than none.