MENU
Question -

Explain Comments in Python.



Answer -

Comments in Python :
A hash sign (#) that is not inside a string literal begins a comment. All characters after the # and up to the physical line end are part of the comment, and the Python interpreter ignores them.

# !/usr/bin/python
# First comment
print
тАЬHello, Python!тАЭ
;
# second comment
This will produce following result:
Hello, Python!
A comment may be on the same line after a
statement or expression:
name
=
тАЬMadisettiтАЭ
# This is again comment
You can comment multiple lines as follows :
# This is a comment.
# This is a comment, too.
# This is a comment, too.
# I said that already.

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×