Skill-based roadmap
Python for AI
Learn the Python needed to handle data, call APIs and build small AI tools.
Open a step for a lesson, practice and completion checks. Lessons are free to read; API and cloud exercises may incur provider charges. Use sample data and mock responses while learning.
Step 1Write and run small programs
Start with the core language and a repeatable way to run your work.
Learn
- Interpreter and virtual environments
- Values and types
- Conditions and loops
- Reading error messages
Lesson: Python: numbers, text and lists ↗
Put it into practice
Write a script that converts a list of task durations into a total and average. Handle an empty list and invalid input explicitly.
You’re done when
- Your program computes totals and averages for a valid list.
- Empty lists and invalid values produce clear, deliberate results.
Step 2Organise logic into functions
Small functions make a program easier to reason about and test.
Learn
- Parameters and return values
- Lists and dictionaries
- Modules and imports
- Exceptions
Lesson: Python: control flow and functions ↗
Put it into practice
Split the script into functions for reading, validating and summarising data. Add tests for each function's edge cases.
You’re done when
- Reading, validation and summarising are separate callable functions.
- Tests cover valid and invalid inputs for each function.
Step 3Read and transform data
Most useful AI tools need to move information between files and services.
Learn
- Paths and file encodings
- CSV and JSON
- Data cleaning
- Validation
Lesson: Python: reading and writing files ↗
Put it into practice
Read a CSV of sample records, reject malformed rows with a clear reason and write the cleaned result to JSON.
You’re done when
- Valid CSV rows become structured JSON with the intended types.
- Malformed rows are rejected with reasons and file encoding is explicit.
Step 4Call an API reliably
External services can fail, return unexpected data or take too long.
Learn
- HTTP requests
- Environment variables
- Timeouts and status codes
- Validating response data
Lesson: Python: HTTP requests ↗
Put it into practice
Call an API from a command-line tool. Keep secrets out of source control and test success, timeout and invalid response cases using mocks.
You’re done when
- The command-line tool handles success, timeout and malformed API responses.
- Credentials come from the environment and are absent from the repository.
Step 5Build and explain a complete tool
Bring the pieces together in a small project someone else can run.
Learn
- Dependency management
- Automated tests
- Usage documentation
- Safe error handling
Lesson: Python: automated tests ↗
Put it into practice
Publish a document-processing tool with sample data, a README and tests. Ask another person to run it using only the instructions.
You’re done when
- Tests run successfully using the documented setup commands.
- Another person can run the tool with the sample data using only the README.
Build, review, repeat
A small command-line tool with validated inputs, API calls and automated tests.
- Run your work against the completion criteria, including the failure cases.
- Ask someone else to follow your instructions and review the evidence.
- Record what still needs work and uncheck any steps you want to revisit.
Progress is your own checklist, not an assessment or certification.
Choose your next roadmap →