1. Home
  2. Computing & Technology
  3. Python

Beginning Python: Putting It All Together With Syntax

From Al Lukaszewski, for About.com

3 of 10

Comments and Remarks

Any good program should have comments from the programmer written amidst the code in order to explain the flow of the program to others who may read the program. Obviously, these comments are not meant to be executed; they are ignored when the program executes. In order to offset them from the rest of the program and to tell the computer to ignore them, Python uses the hash symbol, or number sign, at the beginning of the comment. Some examples:

# This is a comment
print "This is code."
print "This is code." # But this is a comment.
# Note that comments can be on a line by themselves
# or at the end of a line. But there is no way for
# comments to precede code on the same line.

Explore Python
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.