Deva Point

deva point

Our Latest Programming Tutorial

Easy To Learning

Python Comments

Python Comments

Python are strings that begin with the # (hash/pound symbol). They are made use of to document code and to help other designers recognize the same. You can use Python comments inline, on independent lines, or multiple lines to include larger documentation.

Python Comments are used to make the coding more readable.

#this is a Python comment. I can create whatever I want right here

#print(” I will not be carried out”).

print(” I will certainly be executed”).

Types of Comments

  1. Single Line Comments
  2. Multiline Comments

Single Line Comments

In Python for single line comments use # authorize to comment out everything following it on that line.

Multiline comments in Python can start with “‘ and finish with “‘. Multiline comment is developed just by putting them inside triple-quoted strings:” ‘/””” and also”‘/”” “. Both examples have legitimate syntax in Python.

In Python there is a special sign for remarks which is #. Some languages like Java have indigenous assistance for multiline.

Multiline Lines Comments

Multiline lines commnts are a little different. Merely utilize 3 single quotes prior to and after the component you wish to be commented.

“‘. print (” Multiline line comment line 1″).

print (” I am in Multiline line comment line2″).”‘. print (” I am out of Multiple line comment”).

Published
Categorized as Python

Leave a comment

Your email address will not be published. Required fields are marked *