Quiz Program – Part 1: the basic quiz

Step 4 – Adding a comment

Programs can get pretty long, so it's a good idea to add comments as you go.

Code helper image
  1. Add a new line above the question
  2. 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.

  3. 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.

  4. Run your program. Did the comments make any difference when the program ran?