You already wrote a lot of code, but if they are hard to read, it’s hard to let others to understand your work or add new features to it.
Comments will be ignored when your code is running. It’s only for people to read. Single line comments start with a
Multi-line comments start with
""" and end with another
If you don’t want some lines of code to run, just put a
# in front of it, turn it into a comment. If you want to restore this code, just delete the
Don’t pile all of your code together. Use Blank Lines to divide different parts of your code. For example:
In this case, I used two blank lines to divide data define section, check name section and check age section.
The answer is YES. You may think you can understand your code without any comments or blank lines. Yea... I thought like this when I first learned programming too. But after one month don’t touching your code, you will find out that you have not even a clue what you were writing about.
Next: Lists and Tuples