2,599
edits
Efernandez (talk | contribs) |
Efernandez (talk | contribs) (→Naming) |
||
Line 56: | Line 56: | ||
== Naming == | == Naming == | ||
== Comments == | |||
=== Block comments === | |||
Block comments generally apply to some (or all) code that follows them, and are indented to the same level as that code. Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment). | |||
Paragraphs inside a block comment are separated by a line containing a single #. | |||
=== Inline comments === | |||
Avoid using inline comments. | |||
<syntaxhighlight lang="python"> | |||
x = x + 1 # Inline comment, don't do it | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="python"> | |||
# Do this instead | |||
x = x + 1 | |||
</syntaxhighlight> | |||