Saturday, 1 September 2018

Comments


Comments
Python has comments are used for the purpose of documentation.
comment lines will not executed at runtime.
Comments are start with a #, and Python will render the rest of the line as a comment:
Example
Comments in Python:
#This is a comment.
print("Hello, World!, Welcome to Python!")

Docstrings
Python also has extended documentation called docstrings.
Docstrings can be one line, or multiline.
Python uses triple quotes as docstring:
Example
Docstrings are also comments:
"""This is a
multiline docstring..........."""

print("Hello, World!, Welcome to Python!")

No comments:

Post a Comment

Lists

Python  Lists Python Collections (Arrays) There are four collection data types in the Python programming language: List  is a ...