![]() |
| Comments in Python in Programming |
Python Comments: A comment can be used to explain the source code to make to the readable python code. Python interpreter can not considered as a part of program. In other word we can say that compiler ignores the comment.
Python comments are statements that are not executed by the python interpreter. Comments are the readable functions method or changeable code understand declared using comment. Comments can be used every Programming Languages like C, C++ and Java language.
Types of comments in Python
- Single line comment
- Multiline comment
Single Line Comment in Python
Single line comment: A single comment used to readable python code. Single comment add only one line. Single comment can be used Hash symbol(#).
Single Line Comment Example
#Addition of Two numbers x=50 y=30 print("Addition of x+y:", x+y) ============OUTPUT============ Addition of x+y: 80 |
Multiple Line Comment in Python
Multiline comment: A Multiline comment can be used to comment a block of source code.Multiline comment can be using triple quotes ('" '"). Multiline comment starts with ("') and ends with("'). The text between ("' and "') is not executed by the compiler. Multiline comment is a doc string. It is a printable of console using docstring method(docstring.__doc__).
Multiple Line Comment Example
'''Welcome To Jiocoding Website You can Learn Python Language''' ============OUTPUT============ |
Print Multiple Line Comment Using Docstring
'''Welcome To Jiocoding Website You can Learn Python Language''' print(docstring.__doc__) ============OUTPUT============ This is a Multiline comment it can not be execute python Interpreter Welcome To Jiocoding Website You can Learn Python Language |
Conclusion of Comments in Python Programming
Conclusion: A python comments is a most important part of programming. It can be used understandable source code. I have complete python comments related every concept. It is a all about python comments if your any query or questions than contact me by email or comment. I explain comments related your problem.

0 Comments