Comments are very important in your programs. They are used to tell you what something does in English, and they also are used to disable parts of your program if you need to remove them temporarily. Here's how you use comments in Python:
.. literalinclude:: ex/ex2.py :language: python :linenos:
.. literalinclude:: ex/ex2.txt :language: console
- Find out if you were right about what the # character does and make sure you know what it's called (octothorpe or pound character).
- Take your
ex2.py
file and review each line going backwards. Start at the last line, and check each word in reverse against what you should have typed. - Did you find more mistakes? Fix them.
- Read what you typed above out loud, including saying each character by its name. Did you find more mistakes? Fix them.