Python Comments
Python Tutorial » Python Comments
Comments, usually are used to explain Python code,to make the code more readable and to prevent execution when testing code.
Python will ignore the lines starts with "#" (without quotes), so this is the line comments:
Example:
if 5 > 2:
#a comment: uses indentation, else you will have an error.
print("Five is greater than two!")
#a comment: uses indentation, else you will have an error.
print("Five is greater than two!")
Comments can be placed at the end of a line, and Python will ignore the rest of the line:
Example:
if 5 > 2:
print("Five is greater than two!") #a comment: uses indentation.
print("Five is greater than two!") #a comment: uses indentation.
Python comments multiple lines - examples
Simple, to add a multiline comment in python you could insert a hashtag caracter # for each line:
Example: How to comment in Python more linnes
Nine is greater than seven!
Nine is greater than seven!
#do't forget to uses indentation
#to indicate a block of code
#else, you will have error
if 9 > 7:
print("Nine is greater than seven!")
if 9 > 7:
print("Nine is greater than seven!")
Output:#to indicate a block of code
#else, you will have error
if 9 > 7:
print("Nine is greater than seven!")
if 9 > 7:
print("Nine is greater than seven!")
Nine is greater than seven!
Nine is greater than seven!
Python comments multiple line, how to comment more lines, comment block
Python Comments - python
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.