Python: Comment

By Xah Lee. Date: . Last updated: .

Line Comment

Comment are text 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

Block Comment

There is no block comment in python.