Step 4 – Adding a comment
Programs can get pretty long, so it's a good idea to add comments as you go.
- Add a new line above the question
- Type this code on your new line: # Question 1
This adds a comment. The hashtag shows this and the code turns red to mark it out as a comment.
Comments are for humans. The computer sees the hashtag and ignores the rest of the line.
- Now add a comment right at the beginning of the program to describe what the program is for
Keep gaps in your code as well. This makes it so much easier to read.
- Run your program. Did the comments make any difference when the program ran?