Previous
Python Rules Of Coding: Naming Conventions
Comments :
For In-Code documentation in Python, comments are so essentials. Comments are the extra understanding layer of the code. It should be simple and verbosely so that it can be read and understand easily. Comments start with the '#' (hashtag ) symbol in Python.
Conventions:
- Updating the code and keep changing the comments according to that.
- Comments should be simple, verbose, and complete sentences.
- The way we write a sentence in general comments should be like that.
- If a comment is short and one line, we can avoid using the period in the end.
- Multi-line comments are called block comments. Every sentence must end in a period.
Always try to use inline comments, because it is so important to understand the code easily.