Hive-blogger avatar

Python Rules Of Coding: Comments

alrashel

Published: 01 May 2020 › Updated: 01 May 2020Python Rules Of Coding: Comments

Python Rules Of Coding: Comments

Previous
Python Rules Of Coding: Naming Conventions

code-1084923_1280.png

Source

Python Rules Of Coding: Comments

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:

  1. Updating the code and keep changing the comments according to that.
  2. Comments should be simple, verbose, and complete sentences.
  3. The way we write a sentence in general comments should be like that.
  4. If a comment is short and one line, we can avoid using the period in the end.
  5. Multi-line comments are called block comments. Every sentence must end in a period.

py1.JPG

Always try to use inline comments, because it is so important to understand the code easily.

py2.JPG

Next

String Quotes, and User Documentation

.............................................

Leave Python Rules Of Coding: Comments to:

Written by

Passionate software developer and interests in Travelling, Blogging, Photography and active lifestyle.

Read more #stem posts


Best Posts From Hive-blogger

We have not curated any of alrashel's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Hive-blogger