Python Commenting: Explanation and Purpose

Writing comments in python. Have you ever inspected a python code? And at some point you see a line that starts with a Hashtag #.? That's a comment This is the human consumption part that the interpreter will not execute. Simply put the computer will not execute that line of code. Can you think of having a conversation with a friend about fixing a broken tube for an electric bike? After identifying the puncture in the cause of fixing the tube, you instructed him to be careful when ever he is riding on a rough path. Off course that was nice but not part of the fixing process. though that instructions was taken in, it was not part of the executed instructions on fixing the tube Or can you give a better example than this in the comments section? Comments in Python is a line written in the code which explains what the code does. 🎄It help human read the code and understand what the code does. 🎄 It can describe. explain or remind one about some actions in the code 🎄 Comments allow you and team members understand code and action. 🎄 Comments enhances functionality and structure in which the code is based 🎄 Comments could prevent execution of some part of the code. 🎄It is a good practice to allow comments to be short and precise. Do you have some other things to add? #python #comment #execution #lineofcode

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories