HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

Python Comments


It helps us understand the code better.

Comments can be used to prevent execution when testing code.

Creating a Comment


Comments starts with a #, and Python will ignore them:

Example
#This is a comment
print("Hello, CodeLines!")              
              

Multiline comments


To add a multiline comment you could insert a # for each line:

Example
#This is a comment
#written in
#more than just one line
#written in

print("Hello, CodeLines!")