Python Comments

Comments
•    A comment is a text note added to source code to provide explanatory information, 
•    Usually about the function of the code
•    Use to describe the source code

There are two types of comments
1.    Single line comment/one line comment
2.    Multiple line comment

Single line comment/one line comment 

  • Single Line comments begins with the hash character (#) and ends by the end of the line.
  • Then Python is ignoring all text that comes after the # to the end of the line.

al 7.6-1

 

 

 

 

 

Multiple line comment

  • Multiple line comments use 3 single quotes before and after the part you want commented.
  • al 7.6-2

You may also like...