Comments
In this activity, we look at how to use comments. Comments are common to many coding languages and provide a way to write notes in a source file that will be ignored by the interpreter.
Comments are useful because they allow you to explain what your code is doing, record your thinking, and make programs easier for other people to understand.
What is a Comment?
A comment is text written inside a source file that is intended for human readers rather than the computer. When Python runs the program, comments are ignored and do not affect the output.
Why Comments are Useful
Comments help explain the purpose of code, document assumptions, clarify complex sections, and make your work easier to revisit later. They are especially valuable when code is shared with other users.
Good Practice
Good comments should be clear, concise, and useful. They should explain why something is being done or clarify the purpose of a section of code, rather than simply repeating what is already obvious.
Now that you have written some first lines of Python, the next activity steps back to look at the wider software landscape: the tools people use to write Python code beyond Jupyter Notebooks.