EXERCISE 0: Add comments to explain code

Task 1: Add a comment before your existing welcome message code using the # syntax to explain it.

Task 2: Add a header comment at the very top of your file to:

  • Identify the file, e.g. with a title;
  • Who created it;
  • When it was created;
  • What it is for, i.e. a description of the program and its purpose;

Run and check: Run your code in the terminal with the command:

$ python flashcards_app.py

Your program should work exactly the same as before since comments don’t change how the program runs.

Save your progress: Commit with message “EXERCISE 0: Add comments to explain code” and save your work to Github with the standard Git workflow.

(Re)read through the guides:

Example solution

flashcards_app.py

# Created by: Alex Ubuntu
# Date: 01.01.2026
# Purpose: A personal flashcard trainer to help with learning

# Welcome message
print("Welcome to your personal flashcard trainer!")

Take a break: