Forum Thread: Comments, Python (Part 2)

Comments are like the holy grail in Python. Python is a very delicate and easy language. But of course, to the person on the other side, who does not know much... Python is something impossible. Comments are used to say something in an easier way. They can also disable part of some code you don't want.

Code:

# Whatever you write after the # is ignored by Python.

print "I could have code like this." # This part of the code is ignored.

# If you want to disable part of a code, just type the # and then the code. As the following:

# print "THIS WILL NOT RUN"

print "THIS WILL RUN "

This is all quite simple as you see. Simple Python.

Now we have covered what "Characters" do. Next time, I will be covering what strings are and what they do. Variables and more will be covered also.

2 Responses

Comments are incredibly useful for when developers share information with one another. My friend recently sent me the source for a chrome extension he made and the comments showed what each line of the code did .

Good tutorial, but very short.

Share Your Thoughts

  • Hot
  • Active