codebyexample
project · Python

01 Foundations Project: Student Score Summary

Goal

Build a console program that reads student names and scores, then prints summary statistics.

Learning Metadata

  • Difficulty: Beginner.
  • Estimated Time: 45-75 minutes.
  • Prerequisites: All 01-foundations modules, especially types-and-io, control-flow, and arrays-and-vectors.
  • Learning Focus: Integrate validated input, record storage, and summary statistics in one small end-to-end program.

Learning Outcomes

  • FND-TIO-02
  • FND-CFL-02
  • FND-FUN-01
  • FND-SEQ-02

Quick Run

Run the checkpoint checker from the repository root. The starter is intentionally incomplete, so the first run establishes the work still to do:

python scripts/automation.py check-checkpoint --language python --kind project --level 01-foundations

Requirements

  • Ask for number of students.
  • Read each student name as a full line and score with numeric validation.
  • Keep score input in the range 0 to 100.
  • Print all student records.
  • Print minimum score, maximum score, and average score.

Milestones

  1. Model the input and domain rules.
  2. Implement the smallest end-to-end workflow.
  3. Add validation and boundary behavior.
  4. Refactor only after every configured case passes.

Concepts Practiced

  • Input handling with input.
  • Loops and conditionals.
  • Lists and dictionaries.
  • Basic statistics: min, max, average.

Sample Input

3
Ana Smith
91
Bob Lee
77
Carla Mendez
88

Sample Output

Students:
- Ana Smith: 91
- Bob Lee: 77
- Carla Mendez: 88
Average: 85.33
Minimum: 77
Maximum: 91

Common Pitfalls

  • Accepting empty names.
  • Accepting invalid scores without retrying.
  • Dividing by zero when no students are provided.

Cross-Language Notes

  • Compared with the C++ capstone, this version optimizes for quick readable progress while keeping the same summary goal.
  • Relative to C#, Go, and TypeScript, dynamic values make the first complete program feel lighter but less guarded.
  • The comparison to watch is fast iteration versus compile-time protection.

What To Check

  • invalid score input is rejected or retried without corrupting later reads
  • names with spaces stay intact from input to output
  • reported average, minimum, and maximum match the entered records

Check Your Work

Implement the task in starter/, then run from the repository root:

python scripts/automation.py check-checkpoint --language python --kind project --level 01-foundations

Use --solution only after completing a full attempt. Each failed case reports targeted feedback without exposing the implementation.

Extension Ideas

  • Add grade letters (A/B/C).
  • Sort output by score.
  • Print pass/fail counts using a threshold.

Content revision 1d0b3f4

READ & DOWNLOAD

Take the next step locally.

Online execution for projects and assessments is coming later. Download the starter files and follow the instructions alongside your editor.

View source
def run_project() -> None:
    # TODO 1: Ask for number of students.
    # TODO 2: Read each student name as a full line and score with numeric validation.
    # TODO 3: Keep score input in the range `0` to `100`.
    pass


def main() -> None:
    run_project()


if __name__ == "__main__":
    main()
← Back to the curriculumYour next insight is one experiment away.