Python Foundations · Unit 5

Unit 5: Modules & Packages

Split code across files and use Python's standard library.

  • 1–2 hrs
  • Beginner
  • 10 lessons

Lessons

  1. What Are Modules?What modules are, why modules matter, how modules work, module benefits 15–20 min
  2. Importing Built-in ModulesBasic import, selective import, module aliases, common modules 20–25 min
  3. Creating Your Own ModulesCreating modules, importing custom modules, module organization, best practices 20–25 min
  4. The __name__ == "__main__" PatternWhat __name__ is, the pattern, why it matters, practical use 15–20 min
  5. Working with PackagesWhat packages are, creating packages, importing from packages, package structure 20–25 min
  6. The Python Standard LibraryWhat the standard library is, exploring modules, reading documentation, popular modules 25–30 min
  7. Installing External Packages with pipWhat pip is, installing packages, managing packages, finding packages 20–25 min
  8. Virtual Environments and Dependency ManagementWhat virtual environments are, creating environments, activating environments 25–30 min
  9. Module Aliases and Selective ImportsUsing aliases, selective imports, import best practices, common patterns 20–25 min
  10. Project Organization Best PracticesDirectory structure, naming conventions, package structure, project templates 25–30 min
  11. End of unit test

    Ten multiple choice questions worth 7 points each and one free response problem worth 30, so 100 in total. Score 70 or more to finish Unit 5 and unlock Unit 6.

    Take the Unit 5 test