Python Foundations
Write, structure and test small Python programs and manage their dependencies in an isolated environment.
3 objectives 6 steps about 125 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Write functions that use core data structures (lists, dicts, sets, tuples) and handle errors with exceptions.
- Organize code into modules and a package, with dependencies pinned in an isolated virtual environment.
- Write unit tests with pytest and add type hints that a type checker accepts.
Lesson plan
6 steps, about 125 min · 5 of 5 lessons available so far
- Values, Control Flow, Functions and Classes Concept · 25 min
- Choosing Lists, Dicts, Sets, Tuples and Dataclasses Worked example · 20 min
- Exceptions and Defensive Input Handling Worked example · 15 min
- Modules, Packages and Virtual Environments Lab · 25 min
- Type Hints and Tests with pytest Lab · 25 min
- Check: Read, Fix and Test a Script Knowledge check · 6 questions
Practise it
Build a command-line tool that reads a text file, counts word frequencies and prints the top N words as dataclass records; package it with a pinned dependency file, type hints and at least five pytest tests, one of which covers a missing input file.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Template EngineIntro · 4–8 h
References
Hard prerequisites
None.
Unlocks
On these roadmaps
- Applied AI Engineer
- Backend Engineer
- Machine Learning Engineer
- Data Engineer
- Network Engineer
- Data Structures & Algorithms
Progress and evidence for this skill are shared across all of them.