🌍 Python · subject

Python To-Do List Project Syllabus

The To-Do List Project syllabus for Python in full: 7 chapters, 17 topics and 14 sub-topics, every one listed below, plus 50 To-Do List Project flashcards with answers.

7Chapters
17Topics
14Sub-topics
50Flashcards

To-Do List Project syllabus: all 7 chapters

Expand any chapter to see its topics and sub-topics.

  1. Set Up Environment

    2 topics
    • Install Python
    • Set Up Virtual Environment
  2. Plan the Application

    2 topics
    • Define Features
      • Add Task
      • View Tasks
      • Mark Task as Complete
      • Delete Task
    • Design Data Structure
      • Choose Data Storage Method
      • Define Task Attributes
  3. Set Up Project Structure

    2 topics
    • Create Main Application File
    • Create Modules for Different Features
  4. Implement Features

    4 topics
    • Add Task Feature
      • Create Function to Add Task
      • Update Data Storage
    • View Tasks Feature
      • Create Function to List Tasks
      • Format Task Display
    • Mark Task as Complete Feature
      • Create Function to Update Task Status
      • Update Data Storage
    • Delete Task Feature
      • Create Function to Delete Task
      • Update Data Storage
  5. Test the Application

    3 topics
    • Write Test Cases
    • Run Tests
    • Fix Bugs
  6. Deploy the Application

    2 topics
    • Package the Application
    • Distribute to Users
  7. Maintain the Application

    2 topics
    • Collect User Feedback
    • Implement Improvements

Python To-Do List Project flashcards — 50 questions with answers

  1. What is the recommended source for downloading the official Python interpreter, and how do you verify a successful installation from the command line?

    Download from python.org (the official CPython distribution). Verify by running $python --version$ (or $python3 --version$), which prints the installed version string, e.g. Python 3.12.x.

  2. On Windows, why is the "Add Python to PATH" checkbox important during installation?

    It adds the Python executable directory to the system PATH environment variable so you can invoke `python` and `pip` from any terminal directory without specifying the full install path.

  3. What command verifies that pip (Python's package installer) is available, and what does pip stand for?

    Run `pip --version` (or `python -m pip --version`). pip stands for "Pip Installs Packages," the standard package-management tool for Python.

  4. What is a Python virtual environment and what problem does it solve?

    A virtual environment is an isolated directory containing its own Python interpreter and installed packages. It solves dependency conflicts by keeping each project's packages separate from the global installation and other projects.

  5. Which standard-library module creates virtual environments, and what is the full command to create one named `venv`?

    The `venv` module. Command: `python -m venv venv` (the second `venv` is the target folder name).

  6. How do you activate a virtual environment on macOS/Linux versus Windows?

    macOS/Linux: `source venv/bin/activate`. Windows (cmd/PowerShell): `venv\Scripts\activate`. Once active, the shell prompt is typically prefixed with the environment name.

  7. What command deactivates an active virtual environment, regardless of operating system?

    Simply run `deactivate`. This restores the shell to use the global/system Python interpreter.

  8. How do you record and later reproduce a project's exact dependencies using pip?

    Record with `pip freeze > requirements.txt` to capture installed packages and pinned versions; reproduce with `pip install -r requirements.txt` in a fresh environment.

  9. In the requirements-gathering (Define Features) stage of a to-do app, what is the minimal set of core CRUD-style features a student should list?

    Add a task (Create), View tasks (Read), Mark a task complete (Update), and Delete a task (Delete). These map to the four CRUD operations: Create, Read, Update, Delete.

  10. What is the difference between a functional requirement and a non-functional requirement when defining features?

    A functional requirement describes WHAT the system must do (e.g., "add a task"). A non-functional requirement describes HOW it performs or a quality constraint (e.g., persistence, speed, usability, reliability).

  11. When designing the data structure for a single to-do task, what fields are commonly stored?

    Typically: a unique id, a title/description (string), a completed/done status (boolean), and optionally a creation timestamp, due date, and priority.

  12. Why is a Python dictionary a natural choice for representing one task, and a list a natural choice for the whole to-do collection?

    A dictionary maps named keys (e.g., 'title', 'done') to values, modeling a record with labeled fields. A list maintains an ordered, indexable, mutable sequence of those task dictionaries, allowing iteration and indexed access.

  13. Compare a Python list and a tuple for storing tasks: which is appropriate for a mutable to-do list and why?

    A list is appropriate because it is mutable—tasks can be added, removed, or modified in place. A tuple is immutable, so it cannot grow or change after creation, making it unsuitable for a dynamic task collection.

  14. What is the Big-O time complexity of appending a task to the end of a Python list versus deleting a task by index?

    Appending to the end is amortized $O(1)$. Deleting an element by index (or value) is $O(n)$ because subsequent elements must be shifted to fill the gap.

  15. Why might a dictionary keyed by task id give faster lookups than a list when retrieving a specific task?

    Dictionary key lookup is average-case $O(1)$ (hash-based), whereas searching a list for a task by id requires a linear scan that is $O(n)$.

  16. What is the conventional name for the entry-point file of a Python application, and what idiom guards its startup code?

    The entry-point file is conventionally `main.py`. Startup code is guarded by `if __name__ == "__main__":` so it runs only when the file is executed directly, not when imported as a module.

  17. Explain what the variable `__name__` evaluates to when a file is run directly versus imported.

    When a file is run directly, `__name__` equals the string `"__main__"`. When the file is imported as a module, `__name__` equals the module's name (the filename without the .py extension).

  18. What is a Python module and how does it differ from a package?

    A module is a single `.py` file containing reusable code (functions, classes, variables). A package is a directory of modules, traditionally containing an `__init__.py` file, that groups related modules under one namespace.

  19. When splitting a to-do app into modules for different features, what is a clean separation of concerns you might use?

    Separate by responsibility: e.g., a `storage` module for load/save persistence, a `tasks` module for add/view/complete/delete logic, and `main.py` for the user interface and program flow that imports the others.

  20. What two import syntaxes let `main.py` use a function `add_task` defined in a module `tasks.py`?

    Either `import tasks` then call `tasks.add_task(...)`, or `from tasks import add_task` then call `add_task(...)` directly.

Show the other 30 To-Do List Project flashcards
  1. Write a minimal Python function signature for an "add task" feature that appends a new uncompleted task to a list.

    `def add_task(tasks, title):` whose body does `tasks.append({"title": title, "done": False})`. It mutates the passed-in `tasks` list, adding a dictionary with the title and a default `done` value of False.

  2. Why does appending a dictionary inside a function modify the caller's list without a return statement?

    Lists are passed by object reference; the function receives a reference to the same list object. `append` mutates that shared object in place, so the change is visible to the caller without returning anything.

  3. For the "View Tasks" feature, how can you display tasks with a 1-based number while iterating a 0-based list?

    Use `enumerate(tasks, start=1)`, e.g. `for i, task in enumerate(tasks, start=1): print(i, task["title"])`. The `start=1` argument makes the counter begin at 1 for user-friendly numbering.

  4. When viewing tasks, how would you visually distinguish completed from incomplete tasks in a console app?

    Check each task's `done` boolean and render a marker, e.g. `"[x]"` if `task["done"]` is True else `"[ ]"`, prefixed before the title.

  5. What should the View Tasks feature do when the task list is empty, and why is this an important edge case?

    It should print a friendly message such as "No tasks found" instead of nothing. Handling the empty case prevents confusing blank output and is a common edge case testers check.

  6. For "Mark Task as Complete," how do you convert a user-entered 1-based task number into the correct list index, and what bounds check is needed?

    Subtract 1: `index = number - 1`. Validate that `0 <= index < len(tasks)` before accessing, to avoid an IndexError or modifying the wrong/nonexistent task.

  7. Write the core line that marks the task at position `index` as complete in a list of task dictionaries.

    `tasks[index]["done"] = True`. This sets the `done` key of the selected task dictionary to True.

  8. What Python exception is raised when you access a list position that doesn't exist, and how do you guard against it in the complete/delete features?

    `IndexError`. Guard against it by validating the index range (`0 <= index < len(tasks)`) before access, or by wrapping access in a `try/except IndexError` block.

  9. For the "Delete Task" feature, contrast `del tasks[index]`, `tasks.pop(index)`, and `tasks.remove(value)`.

    `del tasks[index]` removes by position and returns nothing. `tasks.pop(index)` removes by position and returns the removed item. `tasks.remove(value)` removes the first element equal to `value` (by value, not index).

  10. Why can deleting tasks while iterating forward over the same list with `for` cause skipped items, and what is a safe alternative?

    Removing an element shifts later elements left, so the loop's advancing index skips the item that moved into the freed slot. Safe alternatives: iterate over a copy, build a new filtered list with a comprehension, or iterate in reverse.

  11. How would you delete all completed tasks at once using a list comprehension?

    Rebuild the list keeping only incomplete tasks: `tasks = [t for t in tasks if not t["done"]]`. This creates a new list excluding every task whose `done` value is True.

  12. What is the difference between unit testing and integration testing in the context of the to-do app?

    Unit testing verifies a single function in isolation (e.g., `add_task` adds one item). Integration testing verifies that multiple components work together correctly (e.g., add then view then delete behave consistently end-to-end).

  13. Name the two most common Python testing frameworks/modules and one distinguishing feature of each.

    `unittest` (built into the standard library, class-based with `assertEqual` etc.) and `pytest` (third-party, uses plain `assert` statements and concise fixtures). pytest requires installation; unittest does not.

  14. In Python's `unittest`, what base class do test cases inherit from and what naming prefix must test methods use?

    Test cases inherit from `unittest.TestCase`, and each test method name must start with the prefix `test` (e.g., `def test_add_task(self):`) so the runner discovers it.

  15. Describe the Arrange-Act-Assert (AAA) pattern for structuring a single test case.

    Arrange: set up inputs and state (e.g., create an empty task list). Act: invoke the function under test (e.g., call `add_task`). Assert: verify the outcome (e.g., check the list length and contents are correct).

  16. Write a one-line assertion (pytest style) verifying that after adding a task, the list length is 1.

    `assert len(tasks) == 1`. After calling `add_task`, this confirms exactly one task was appended to the previously empty list.

  17. What command runs all tests with pytest, and what command runs unittest test discovery from the command line?

    pytest: simply run `pytest` (it auto-discovers `test_*.py`). unittest: run `python -m unittest` or `python -m unittest discover`.

  18. In test output, what is the difference between a test "failure" and a test "error"?

    A failure means an assertion was checked but the actual result did not match the expected value. An error means the test raised an unexpected exception before/instead of reaching the assertion (a problem in the code or the test setup).

  19. What is code coverage, and roughly what does it measure?

    Code coverage is the percentage of source code lines (or branches) executed while the test suite runs. It is measured with tools like `coverage.py` and indicates how much of the code is exercised by tests—though high coverage does not guarantee correctness.

  20. Define a "bug" and distinguish a syntax error from a logic error in Python.

    A bug is any defect causing incorrect behavior. A syntax error violates Python's grammar so the code won't even run/parse. A logic error runs without crashing but produces the wrong result because the algorithm or condition is incorrect.

  21. What is a traceback in Python and how does it help during the Fix Bugs stage?

    A traceback is the error report Python prints when an unhandled exception occurs, listing the call stack from the entry point down to the line that raised the error. It pinpoints the file, line number, and exception type to locate the bug.

  22. Name two debugging techniques: the simplest print-based one and the standard-library interactive debugger.

    Print debugging: inserting `print()` statements to inspect variable values at runtime. Interactive debugging: using `pdb` (e.g., `import pdb; pdb.set_trace()` or `breakpoint()`) to step through code, inspect state, and set breakpoints.

  23. What is a regression, and how do automated tests help prevent regressions when fixing bugs?

    A regression is when a previously working feature breaks due to a new change. Re-running the automated test suite after each fix catches regressions immediately, because broken behavior surfaces as a newly failing test.

  24. What does it mean to "package" a Python application, and which two files commonly configure modern packaging?

    Packaging means bundling code, metadata, and dependencies into a distributable, installable format. Modern configuration uses `pyproject.toml` (and historically `setup.py`/`setup.cfg`) to declare the project name, version, dependencies, and entry points.

  25. What are the two standard Python distribution formats produced for PyPI, and which is the preferred binary format?

    An sdist (source distribution, a `.tar.gz`) and a wheel (`.whl`). The wheel is the preferred built/binary format because it installs faster without a build step.

  26. What is semantic versioning (SemVer), and what do the three numbers in $MAJOR.MINOR.PATCH$ signify?

    SemVer is a versioning convention $MAJOR.MINOR.PATCH$: increment MAJOR for incompatible (breaking) API changes, MINOR for new backward-compatible features, and PATCH for backward-compatible bug fixes.

  27. Contrast packaging a console-distributable wheel (via pip) with bundling a standalone executable using a tool like PyInstaller.

    A wheel requires the end user to have Python and pip installed, then `pip install` the package. PyInstaller bundles the interpreter and dependencies into a single self-contained executable that runs on machines without Python installed.

  28. What is PyPI, and what command-line tool is conventionally used to upload a built distribution to it?

    PyPI is the Python Package Index, the public repository for Python packages. `twine` is the standard tool used to securely upload built sdists and wheels, e.g. `twine upload dist/*`.

  29. List three common channels for distributing a finished to-do app to users.

    Publishing to PyPI for `pip install`; sharing the source repository (e.g., GitHub) with install instructions; and distributing a standalone executable/installer built with a tool like PyInstaller. (Containerizing with Docker is another option.)

  30. Name three effective methods for collecting user feedback after release, and explain why feedback drives the Implement Improvements stage.

    Methods: a GitHub issue tracker, surveys/feedback forms, and in-app analytics or direct user interviews. Feedback identifies real bugs, pain points, and desired features, so improvements are prioritized by actual user needs rather than guesswork—closing the iterative development loop.

Python To-Do List Project FAQ

What is in the Python To-Do List Project syllabus?

Python To-Do List Project is split into 7 chapters: Set Up Environment, Plan the Application, Set Up Project Structure, Implement Features, Test the Application, Deploy the Application and Maintain the Application. Together they contain 17 topics and 14 sub-topics.

How many chapters are in Python To-Do List Project?

7 chapters, containing 17 topics and 14 sub-topics. The largest chapter is Implement Features, with 4 topics.

Are there flashcards for Python To-Do List Project?

Yes — a 50-card To-Do List Project deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.