Free coding foundation

Python Foundations for AI

Move from using AI tools to understanding the code and data skills behind them. This course teaches beginner-friendly Python with examples aimed at notebooks, datasets, and AI practice.

  • Available now
  • Free course
  • Beginner to practical
  • No prior coding experience required
  • Self-paced browser course

Start course
Start with AI Foundations

Read lessons without an account. Sign in only to save continuation, completion, and learner badges. No certificate or formal credential is issued.

Bridge from AI concepts

Turn AI understanding into practical coding confidence

AI Foundations helps you understand the concepts. Python Foundations helps you begin building: reading code, working with data, using notebooks, and understanding the examples that appear in AI and machine learning tutorials.

  • AI Foundations helpful
  • No prior programming needed
  • Built for notebooks and data
Read Python clearly

Understand variables, values, expressions, and the shape of simple Python programs.

Use core structures

Work with strings, lists, tuples, dictionaries, and common patterns for organizing information.

Control program flow

Use conditions and loops to make small programs respond to data and decisions.

Write functions

Package repeated logic into readable, reusable building blocks.

Debug with evidence

Read tracebacks, handle expected errors, and use small tests to confirm that code behaves as intended.

Work with data

Load, clean, transform, and explore simple datasets: the everyday substrate of AI work.

Use notebooks

Feel comfortable in the standard environment for AI, data, examples, and experiments.

Syllabus

Ten modules from first code to an AI-ready data project

The sequence gives core Python, problem-solving, debugging, files, NumPy, and pandas separate room to develop. Every module includes code practice, and the final project combines the skills without pretending that introductory Python alone makes someone an AI engineer.

Module 01

Running Python and thinking in steps

  • How Python executes code
  • Notebook cells, kernels, state, and execution order
  • Reading code and using built-in help
  • Checkpoint: build and rerun a small notebook without hidden state
Module 02

Values, variables, types, and text

  • Numbers, strings, booleans, and None
  • Variables, arithmetic, comparisons, and conversion
  • Indexing, slicing, string methods, and formatting
  • Checkpoint: clean and summarise a supplied block of messy text
Module 03

Collections and structured information

  • Lists, tuples, dictionaries, and sets
  • Mutability, copying, membership, and nested structures
  • Collection operations and conversions
  • Checkpoint: represent and transform a small labelled dataset
Module 04

Conditions, loops, and problem decomposition

  • Boolean logic and branching
  • For and while loops, range, break, and continue
  • Accumulators, readable comprehensions, and edge cases
  • Checkpoint: validate supplied records and report rejected values
Module 05

Functions, modules, and readable code

  • Parameters, return values, scope, and side effects
  • Docstrings, basic type hints, naming, and separation of concerns
  • Imports, standard-library modules, packages, and environments
  • Checkpoint: convert repeated cleaning logic into documented functions
Module 06

Errors, debugging, validation, and tests

  • Syntax, runtime, and logic errors
  • Tracebacks, reproducible failures, input validation, and exceptions
  • Assertions, focused tests, and generated-code review
  • Checkpoint: diagnose, repair, and explain a broken program
Module 07

Files, paths, CSV, and JSON

  • Portable paths, text encodings, and context managers
  • CSV and JSON structure
  • File validation, provenance, and non-destructive outputs
  • Checkpoint: convert supplied records between CSV and JSON
Module 08

NumPy foundations

  • Arrays, shapes, dimensions, and data types
  • Indexing, slicing, masks, and vectorised operations
  • Aggregation, axes, broadcasting, copies, and views
  • Data project: analyse and validate a supplied numerical dataset
Module 09

pandas and practical data preparation

  • DataFrames, selection, missing values, and data types
  • Cleaning, derived columns, grouping, and simple plots
  • Combining tables, checking unmatched records, and exporting results
  • Data project: prepare and explain a messy, rights-cleared dataset
Module 10

Capstone: reproducible AI-ready data notebook

  • Define a bounded question and inspect the supplied dataset
  • Plan, clean, validate, transform, and summarise the data
  • Record provenance, assumptions, limitations, and responsible-use checks
  • Final deliverable: a rerunnable notebook, data note, findings note, and reflection
Course format

Designed for learners who are new to code

Audience

Beginners with no programming background, professionals moving toward technical AI work, and learners continuing from AI Foundations.

Prerequisites

No prior programming required. AI Foundations or equivalent familiarity with AI concepts is recommended.

Format

Self-paced online lessons with hands-on coding activities in every module.

Related courses

Continue toward machine learning

After Python Foundations, Machine Learning Foundations becomes much easier to follow because datasets, notebooks, and code examples already feel familiar.

Next: Machine Learning Foundations
Choose route

Python Foundations module visual

Course status: available now

Work through ten text-first modules, practise in the browser-based Python lab, or download the complete notebook pack for local Jupyter. Use only the supplied fictional and synthetic data.

Start course