Python
Your browser doesn't support speech here. You can still read everything, or try Chrome, Edge or Safari.

← All courses

Course 1 of 10 · Beginner

Python

Your first programming language, for AI. Variables, loops, functions, data structures, files, classes and Pythonic code, then NumPy, pandas, plotting and the developer tools every AI engineer uses.

How this course works

Welcome

  • Level: Beginner. You need: No prior knowledge.
  • Starting from zero? Begin with Start here. Every code example runs in the page, so you need nothing installed until the Tools topic.
  • Already program in another language? Skim Python basics and try the checkpoint.
  • Pick a topic from the sidebar; they go in order. Press ▶ Play this topic to hear a lesson read aloud, or 🔊 Explain on one section.
  • Topics climb from Beginner to Intermediate · Maths, Advanced and Code; use the Show chips to hide levels you don't need. Most have a Watch it animation, Try it demos and runnable code examples, and every topic ends with a quiz: answer it to mark the topic done ✓.
  • Stuck? Press 💬 Ask the AI tutor: a small free AI model that runs on your own device and answers from the course.
  • Progress is saved in this browser and shared across all the courses on this site.

Learning path: 🐍 Python → 🗄️ SQL & Databases → ∑ Maths for AI → 📈 Machine Learning → 🧠 Deep Learning → 👁️ Computer Vision → 💬 Natural Language Processing → ✨ Generative AI & LLM Apps → 🚀 Flask & Deployment → 🔬 Becoming an AI Researcher

Getting started

Python basics

4. Values, Variables & NumbersStore values in variables, meet the basic types (whole numbers, decimals, text and True/False), do arithmetic, and convert between types. Then watch variables change one line at a time.5. Strings: Working with TextText is everywhere in data. Index and slice strings, use the most useful string methods (strip, lower, split, replace, find, join), format output with f-strings, and handle quotes, new lines and special characters.6. Making Decisions: if, elif & elseLet your program choose what to do: comparisons, True and False, if, elif and else, combining tests with and, or and not, and the indentation that shows which lines belong to each choice.7. Loops: Repeating Work with for & whileMake the computer do the repetitive work: for loops over lists, strings and range, counting and adding up with loops, while loops that repeat until something happens, break and continue, loops inside loops, and how to avoid endless loops.8. Lists & Tuples: Ordered CollectionsKeep many values in one variable: create lists, read items by position, add, remove, sort and search, slice and copy safely, and use tuples for fixed groups of values. Then see why two names can point to one list.9. Dictionaries & Sets: Look Things Up FastStore values by name instead of by position: create dictionaries, read, add, update and delete entries, loop over keys and values, count things, use nested records like JSON, and remove duplicates and compare groups with sets.10. Functions: Write Code Once, Use It Many TimesPackage steps into your own functions: def, parameters and arguments, return values, the difference between print and return, default values, keyword arguments and docstrings. Then watch a function call step by step.11. More Functions: Scope, Lambdas & RecursionWhere variables live (local and global scope), functions as values, lambda and sorting with a key, *args and **kwargs, the mutable default trap, and recursion: functions that call themselves.

Writing real programs

Python for data

Tools of the trade

When you finish

Next course

Ready