In the last article , we introduced statements and indentation in Python. Next, let’s discuss commenting in Python. Comments are descriptions of the code under consideration. So we can write one or more lines of explanation. There can be times when you need to write some long and complicated code for a task. After it is complete, you might save the file somewhere, but when you refer to the code sometime in the future, let’s say, after three or four months, you may not be able to understand the code you have written yourself! To help yourself and anyone going through your code, in the hope of understanding its utility, you should generously use comments to clarify the written code. Commenting is necessary, especially for the complicated functions you might have created for a specific task. There are a few ways to declare a comment inside Python. The easiest way is to use a hash symbol (#). When we use the hash symbol inside our code, the python interpreter igno...
Comments
Post a Comment