comment
Text in a program after a # sign, which Python ignores and which exists only for human readers.
In more detail
Use comments to explain why code does something, not to repeat what it obviously does. Putting # in front of a line, commenting it out, is a quick way to switch it off while testing. Docstrings, not comments, document what a function does.
Related terms
- docstring — A string literal placed as the first statement of a module, function or class, which Python keeps as its documentation.
- source code — The human-readable text of a program, as written in a programming language and saved in a file.
Taught in
- Installing Python On A Mac — Hands-on Python: Complete Video Course & Book
- A Sample Program, Explained — Hands-on Python: Complete Video Course & Book
- Literals, Identifiers And Keywords — Hands-on Python: Complete Video Course & Book
- Playing Computer — Hands-on Python: Complete Video Course & Book
- Interactive While Loops — Hands-on Python: Complete Video Course & Book
- Composing Web Pages In Python — Hands-on Python: Complete Video Course & Book
- Interpreter, Compiler, And What Counts As Syntax — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Fundamentals Sprint — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep