# Learn Python > Free Python tutorials plus the part nobody else covers: how to configure coding agents for Python, and how to review the Python they write. Canonical: https://learn-python.com/ Licence: content free to read and quote with attribution to Learn Python (https://learn-python.com/). Maintainer: Code Learning Dojo. Last built 2026-09-06. ## Foundations The syntax and the mental model. Short, runnable, no fluff. - [Hello, World!](https://learn-python.com/hello-world/): Python is a very simple language, and has a very straightforward syntax. It encourages programmers to program without boilerplate (prepared) code. - [Variables and Types](https://learn-python.com/variables-and-types/): Python is completely object oriented, and not “statically typed”. You do not need to declare variables before using them, or declare their type. - [Lists](https://learn-python.com/lists/): Lists are very similar to arrays. They can contain any type of variable, and they can contain as many variables as you wish. - [Basic Operators](https://learn-python.com/basic-operators/): This section explains how to use basic operators in Python. - [String Formatting](https://learn-python.com/string-formatting/): Python uses C-style string formatting to create new, formatted strings. - [Basic String Operations](https://learn-python.com/basic-string-operations/): Strings are bits of text. They can be defined as anything between quotes: As you can see, the first thing you learned was printing a simple sentence. - [Conditions](https://learn-python.com/conditions/): Python uses boolean logic to evaluate conditions. The boolean values True and False are returned when an expression is compared or evaluated. - [Loops](https://learn-python.com/loops/): There are two types of loops in Python, for and while. For loops iterate over a given sequence. - [Functions](https://learn-python.com/functions/): Functions are a convenient way to divide your code into useful blocks, allowing us to order our code, make it more readable, reuse it and save some time. - [Classes and Objects](https://learn-python.com/classes-and-objects/): Objects are an encapsulation of variables and functions into a single entity. Objects get their variables and functions from classes. - [Dictionaries](https://learn-python.com/dictionaries/): A dictionary is a data type similar to arrays, but works with keys and values instead of indexes. - [Modules and Packages](https://learn-python.com/modules-and-packages/): In programming, a module is a piece of software that has a specific functionality. - [Files and Context Managers](https://learn-python.com/files-and-context-managers/): Reading and writing files, and the `with` statement that guarantees cleanup — the single most idiomatic construct in Python. - [Generators](https://learn-python.com/generators/): Generators are very easy to implement, but a bit difficult to understand. Generators are used to create iterators, but with a different approach. - [List Comprehensions](https://learn-python.com/list-comprehensions/): List Comprehensions is a very powerful tool, which creates a new list based on another list, in a single, readable line. - [Multiple Function Arguments](https://learn-python.com/multiple-function-arguments/): Every function in Python receives a predefined number of arguments, if declared normally, like this: It is possible to declare functions which receive a variable number of arguments, using the following syntax: The “therest” variable is a list of variables, which receives all arguments which were given to the “foo” function after the first 3 arguments. - [Regular Expressions](https://learn-python.com/regular-expressions/): Regular Expressions (sometimes shortened to regexp, regex, or re) are a tool for matching patterns in text. In Python, we have the re module. - [Exception Handling](https://learn-python.com/exception-handling/): When programming, errors happen. It’s just a fact of life. Perhaps the user gave bad input. Maybe a network resource was unavailable. - [Sets](https://learn-python.com/sets/): Sets are lists with no duplicate entries. - [Serialization](https://learn-python.com/serialization/): Python provides built-in JSON libraries to encode and decode JSON. In Python 2.5, the simplejson module is used, whereas in Python 2.7, the json module is used. - [Partial functions](https://learn-python.com/partial-functions/): You can create partial functions in python by using the partial function from the functools library. - [Code Introspection](https://learn-python.com/code-introspection/): Code introspection is the ability to examine classes, functions and keywords to know what they are, what they do and what they know. - [Closures](https://learn-python.com/closures/): A Closure is a function object that remembers values in enclosing scopes even if they are not present in memory. - [Decorators](https://learn-python.com/decorators/): Decorators allow you to make simple modifications to callable objects like functions, methods, or classes. We shall deal with functions for this tutorial. - [Map, Filter, Reduce](https://learn-python.com/map-filter-reduce/): Map, Filter, and Reduce are paradigms of functional programming. - [Numpy Arrays](https://learn-python.com/numpy-arrays/): Numpy arrays are great alternatives to Python Lists. - [Pandas Basics](https://learn-python.com/pandas-basics/): Pandas is a high-level data manipulation tool developed by Wes McKinney. It is built on the Numpy package and its key data structure is called the DataFrame. - [Type Hints](https://learn-python.com/type-hints/): Optional annotations that a checker enforces before your code runs. Python stays dynamic; you get most of the safety anyway. - [Dataclasses](https://learn-python.com/dataclasses/): A decorator that writes the boilerplate for classes that mostly hold data — which is most classes. - [Async and Await](https://learn-python.com/async-await/): Concurrency for I/O-bound work — and the one mistake that silently makes an async program slower than the synchronous version. ## AI-Native Configuring agents, harnesses and feedback loops for this language. Updated as the tooling moves. - [Setting up a coding agent for a Python project](https://learn-python.com/ai/agent-setup/): The twenty minutes of setup that decide whether an agent is useful on your Python codebase or an expensive way to generate rework. - [Writing an AGENTS.md for Python that agents actually follow](https://learn-python.com/ai/agents-md/): Most AGENTS.md files are 400 lines of advice the model already knew. Here is what earns its place in the context window, and a Python template you can copy. - [The verification loop: giving an agent something it cannot fake](https://learn-python.com/ai/feedback-loops/): An agent is only as good as the signal it gets back. Here is how to build a Python feedback loop that is fast, honest, and hard to game. - [Structuring a Python repo an agent can navigate](https://learn-python.com/ai/context/): Codebase layout used to be a question of taste. It is now a performance parameter — for your agent and, it turns out, for the humans too. - [MCP servers worth wiring into a Python project](https://learn-python.com/ai/mcp/): MCP lets an agent reach outside your codebase. Most of what gets installed is noise; a few of them change what the agent can actually do. - [From issue to pull request: running a feature with an agent](https://learn-python.com/ai/spec-to-pr/): The end-to-end workflow, including the two steps everybody skips and then pays for later. - [When not to hand it to the agent](https://learn-python.com/ai/when-not-to/): The cases where delegating costs more than doing it yourself — and the one that quietly costs the most. - [Testing Python code that calls a language model](https://learn-python.com/ai/evals/): Your function is now non-deterministic, slow, costs money per call and fails in ways an assertion cannot express. Here is a test strategy that still works. - [Tracking and cutting token costs in Python](https://learn-python.com/ai/tokenomics/): Counting tokens before you send them, attributing every call to a feature, and the four changes that usually halve the bill. ## Review & Verify How generated code fails in this language, and the checks that catch it before your users do. - [The Python mistakes language models actually make](https://learn-python.com/review/failure-modes/): A working catalogue of the bugs that show up over and over in generated Python — what each one looks like, why models produce it, and the check that catches it. - [Hallucinated packages, slopsquatting, and dependency hygiene](https://learn-python.com/review/dependencies/): Language models invent package names. Attackers have noticed, and register them. Here is the check that takes four seconds. - [Security review checklist for AI-generated Python](https://learn-python.com/review/security/): Generated code is not more malicious than human code. It is more confidently insecure, in a small number of predictable ways, at higher volume. - [The performance traps in generated Python](https://learn-python.com/review/performance/): Generated Python is usually correct and frequently slow, in a small number of recognisable ways. None of them show up in a test. ## Reference pages - [About Learn Python, and how we make money](https://learn-python.com/about/): Editorial policy, sourcing, corrections and affiliate disclosure for Learn Python, part of the Code Learning Dojo network. - [The Python stack we would set up today](https://learn-python.com/tools/): A current, opinionated Python toolchain: package manager, linter, type checker, test runner, editor, agent, and hosting. What we use, what we would skip, and why.