Python: Comment

By Xah Lee. Date: . Last updated: .

Single Line Comment

Comment are text in the code and is ignored by the compiler.

Comment syntax start with # (U+23: NUMBER SIGN) to end of line.

Same in python 2 and 3.

# this line is a comment
print(3 + 4) # returns 7. also comment

Multi-Line Comment

There is no multi-line comment in python.