Comments in Python.
Python Comments:
A comment in python starts with the hash character(#). Comments are in the source code for humans to read, not for computers to execute.
Example:
Types of Python comments:
1)Single lined comment
2)Multi lined comment
3)Inline comments
Single lined comment:
In case user want to specify a single line comment,then comment must start with #.
Example:
Output:
Multi lined comments:
Multi lined comment can be given inside triple quotes.
Example:
Inline comments:
If a comment is placed on the same line as a statements,it is called an inline comments. Similar to the block comments, an inline comments beigns with a single hash(#) sign and followed by a space and comment.
Example:
Comments
Post a Comment