1.

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.



Discussion

No Comment Found