Skip to content

Latest commit

 

History

History
54 lines (32 loc) · 1.38 KB

File metadata and controls

54 lines (32 loc) · 1.38 KB

Week 03 Friday: Modular system review

Learning objectives

  • Explain package layout and reusable code.
  • Apply today's ideas in a small Python program.
  • Inspect output and improve the program after a test run.

Concepts students must understand

  • package layout
  • reusable code
  • error paths
  • code review

Detailed lesson content

Demonstrate a student system split into focused files. Review imports, function names, and error paths. Explain how a future class or API could reuse the business rules.

Before coding, describe the input, processing, and output in ordinary language. Run the smallest possible version, then extend it one change at a time. Read the error message before asking for help.

Code example

from grades import calculate_grade
print(calculate_grade(50))

Practical coding activity

Trace one request from input through a function to output.

Guided exercise

Review a peer's modules for one duplicated responsibility.

Independent exercise

Submit the modular student management system.

Expected output

The programme imports modules and handles an invalid score.

Homework or assignment

Write a README with folder layout and run steps.

Recommended learning resources