Learn what's new in Python 3.14, including an upgraded REPL, template strings, lazy annotations, and subinterpreters, with examples to try in your code.| Real Python
In this quiz, you'll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you'll review the key updates and improvements in this version of Python.| Real Python
Covers Python 3.14's key changes: free-threading, subinterpreters, t-strings, lazy annotations, new REPL features, and improved error messages.| Real Python
The final release of Python 3.14 is almost here! Plus, there's Django 6.0 alpha, key PEP updates, PSF board results, and fresh Real Python resources.| Real Python
What's changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python.| Real Python
Python 3.14 includes ten improvements to error messages, which help you catch common coding mistakes and point you in the right direction.| Real Python
Test your knowledge of Python MCP. Practice installation, tools, resources, transports, and how LLMs interact with MCP servers.| Real Python
Explore how Python 3.14 improves error messages with clearer explanations, actionable hints, and better debugging support for developers.| Real Python
Ruff is a blazing-fast, modern Python linter with a simple interface that can replace Pylint, isort, and Black—and it's rapidly becoming popular.| Real Python
Test your Ruff skills in a quick quiz. Practice installation checks, continuous linting, formatting, rule selection, auto-fixes, and config.| Real Python
Learn to use ty, an ultra-fast Python type checker written in Rust. Get setup instructions, run type checks, and fine-tune custom rules in personal projects.| Real Python
Test your knowledge of Astral's ty—a blazing-fast, Rust-powered Python type checker. You'll cover installation, usage, rule configuration, and the tool's current limitations.| Real Python
What's a good way to enable or disable code paths without redeploying the software? How can you use feature flags to toggle functionality for specific users of your application? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| Real Python
Learn how to build a Model Context Protocol (MCP) server in Python. Connect tools, prompts, and data to AI agents like Cursor for smarter assistants.| Real Python
Use Python's .strip() to remove whitespace or chosen chars. Learn pitfalls, real-world cases, and compare with .lstrip() and .removesuffix().| Real Python
Test your Python skills on removing characters from strings using strip, lstrip, and rstrip. Practice default behavior, custom chars, and more.| realpython.com
FastAPI is the first choice when creating APIs in Python. Explore FastAPI code examples and get the most frequent questions about FastAPI answered.| Real Python
This hands-on quiz will test your knowledge of FastAPI basics, from installation and endpoints to automatic JSON responses and Swagger UI.| Real Python
When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, "AI Agents with MCP".| Real Python
Test your knowledge of running Python interactively using REPL, scripts, and IDEs, and clarify key concepts.| Real Python
Review where Python shines: web, APIs, CLIs, GUIs, data science, ORMs, automation, and robots. Practice key terms, tools, and workflows.| Real Python
Explore Python 3.14 REPL updates: import autocompletion, syntax coloring, and theme customization to help you code faster and read with ease.| Real Python
Take this quiz to explore Python 3.14's REPL upgrades! Test your knowledge of new autocompletion tools and built-in syntax highlighting.| Real Python
Create and manage Python projects with uv, a blazing-fast package and project manager built in Rust. Learn setup, workflow, and best practices.| Real Python
Wondering what the arrow notation means in Python? Discover how -> is used in type hints, functions, and more, with clear explanations and examples.| Real Python
What are your options for hosting your Python application or scripts? What are the advantages of a platform as a service, container-based hosts, or setting up a virtual machine? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| Real Python
Learn how to use .dropna() to drop null values from pandas DataFrames so you can clean missing data and keep your Python analysis accurate.| Real Python
Master Python string splitting with .split() and re.split() to handle whitespace, delimiters and multiline text.| Real Python
The Python documentary debuts! Explore Python's journey, 2025 survey results, explosive growth, and key September news updates.| Real Python
Test your skills in sorting Python dictionaries by keys and values. Learn about insertion order, dictionary views, and sorting techniques.| realpython.com
Python's pathlib module enables you to handle file and folder paths in a modern way. This built-in module provides intuitive semantics that work the same way on different operating systems. In this tutorial, you'll get to know pathlib and explore common tasks when interacting with paths.| realpython.com
In this tutorial, you'll be examining a couple of methods to get a list of files and folders in a directory with Python. You'll also use both methods to recursively list directory contents. Finally, you'll examine a situation that pits one method against the other.| realpython.com
In this Python Basics Exercises course, you'll review how to use Python to work with your computer's file system. Then, you'll tackle a coding challenge to further develop your skills.| realpython.com
In this video course, you'll learn how to use the pathlib module to carry out file path operations with Python. These operations include creating, iterating over, searching for, moving, and deleting files and folders.| realpython.com
In this tutorial, you'll learn what a callable is in Python and how to create callable instances using the .__call__() special method in your custom classes. You'll also code several examples of practical use cases for callable instances in Python.| realpython.com
In this tutorial, you'll learn how and when to use the len() Python function. You'll also learn how to customize your class definitions so that objects of a user-defined class can be used as arguments in len().| realpython.com
Fundamental building blocks used to store and manipulate different kinds of data with Python.| realpython.com
What's happening with the latest releases of large language models? Is the industry hitting the edge of the scaling laws, and do the current benchmarks provide reliable performance assessments? This week on the show, Jodie Burchell returns to discuss the current state of LLM releases.| Real Python
Explore Python’s evolution from the 1990s to today with a brief history and demos of key features added throughout its lifetime.| Real Python
In this tutorial, you'll learn how to properly define constants in Python. By coding a bunch of practical example, you'll also learn how Python constants can improve your code's readability, reusability, and maintainability.| realpython.com
What is a good way to add isolated, reusable functionality to Python classes? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| Real Python
Learn to profile Python programs with built-in and popular third-party tools, and turn performance insights into faster code.| Real Python
In this tutorial, you'll learn about recursion in Python. You'll see what recursion is, how it works in Python, and under what circumstances you should use it. You'll finish by exploring several examples of problems that can be solved both recursively and non-recursively.| realpython.com
What went into developing the open-source Python tools data scientists use every day? This week on the show, we talk with Travis Oliphant about his work on SciPy, NumPy, Numba, and many other contributions to the Python scientific community.| Real Python
Understand the difference between shallow and deep copies in Python. Learn how to duplicate objects safely using the copy module and other techniques.| realpython.com
When considering an object-oriented programming problem, should you prefer inheritance or composition? Why wouldn't it just be simpler to use functions? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| realpython.com
Understand Python's with statement and context managers to streamline the setup and teardown phases in resource management. Start writing safer code today!| realpython.com
Explore Python's .__dict__ attribute to manage class and instance attributes directly for more flexible, low-level control of your objects.| realpython.com
In this tutorial, you'll learn about the Python modulo operator (%). You'll look at the mathematical concepts behind the modulo operation and how the modulo operator is used with Python's numeric types. You'll also see ways to use the modulo operator in your own code.| realpython.com
Python 3.14 enters its release candidate phase, Django turns 20, and exciting updates about tools, libraries, and the Python community.| realpython.com
In this tutorial, you'll learn about the built-in Python Boolean data type, which is used to represent the truth value of an expression. You'll see how to use Booleans to compare values, check for identity and membership, and control the flow of your programs with conditionals.| realpython.com
In this step-by-step tutorial you'll learn how to work with conditional ("if") statements in Python. Master if-statements and see how to write complex decision making code in your programs.| realpython.com
In this step-by-step tutorial, you will learn how to leverage single and multiple inheritance in your object-oriented application to supercharge your classes with Python super().| realpython.com
In this tutorial, you'll learn the difference between the string representations returned by .__repr__() vs .__str__() and understand how to use them effectively in classes that you define.| realpython.com
In this step-by-step tutorial, you'll learn how to use args and kwargs in Python to add more flexibility to your functions. You'll also take a closer look at the single and double-asterisk unpacking operators, which you can use to unpack any iterable object in Python.| realpython.com
In this step-by-step tutorial, you'll learn how Python's map() works and how to use it effectively in your programs. You'll also learn how to use list comprehension and generator expressions to replace map() in a Pythonic and efficient way.| realpython.com
In this step-by-step tutorial, you'll learn how Python's .append() works and how to use it for adding items to your list in place. You'll also learn how to code your own stacks and queues using .append() and .pop().| realpython.com
In this step-by-step tutorial, you'll learn about generators and yielding in Python. You'll create generator functions and generator expressions using multiple Python yield statements. You'll also learn how to build data pipelines that take advantage of these Pythonic tools.| realpython.com
What are the advantages of using Polars for your Python data projects? When should you use the lazy or eager APIs, and what are the benefits of each? This week on the show, we speak with Jeroen Janssens and Thijs Nieuwdorp about their new book, _Python Polars: The Definitive Guide_.| Real Python
Python 3.14 introduces t-strings: a safer, more flexible alternative to f-strings. Learn how to process templates securely and customize string workflows.| Real Python
Do the design patterns learned in other programming languages translate to coding in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| Real Python
What are the ways you can manage multithreaded code in Python? What synchronization techniques are available within Python's threading module? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.| realpython.com
Learn Python online: Python tutorials for developers of all skill levels, Python books and courses, Python news, code examples, articles, and more.| realpython.com
In this tutorial, you'll learn how Python mutable and immutable data types work internally and how you can take advantage of mutability or immutability to power your code.| realpython.com
In this step-by-step tutorial, you'll implement the classic hash table data structure using Python. Along the way, you'll learn how to cope with various challenges such as hash code collisions while practicing test-driven development (TDD).| realpython.com
In this tutorial, you'll learn how you can work with files in Python by using built-in modules to perform practical tasks that involve groups of files, like renaming them, moving them around, archiving them, and getting their metadata.| realpython.com
In this tutorial, you'll learn what magic methods are in Python, how they work, and how to use them in your custom classes to support powerful features in your object-oriented code.| realpython.com
In this step-by-step tutorial, you’ll learn all about Python’s math module for higher-level mathematical functions. Whether you’re working on a scientific project, a financial application, or any other type of programming endeavor, you just can’t escape the need for math!| realpython.com
In this tutorial, you'll learn how to use Python's assignment operators to write assignment statements that allow you to create, initialize, and update variables in your code.| realpython.com
In this tutorial, you'll learn the basics of the C language, which is used in the source code for CPython, the most popular Python implementation. Learning C is important for Python programmers interested in contributing to CPython.| realpython.com
If you use Python's print() function to get information about the flow of your programs, then logging is the natural next step for you. This tutorial will guide you through creating your first logs and show you ways to curate them to grow with your projects.| realpython.com
The Zen of Python is a list of 19 guiding principles for good programs. Understand its purpose, history, and hidden jokes to improve your code today!| realpython.com
Model citizens use context managers to open and close file resources in Python, but have you ever wondered why it's important to close files? In this tutorial, you'll take a deep dive into the reasons why it's important to close files and what can happen if you don't.| realpython.com
In this tutorial, you'll learn how to use the Python standard REPL (Read-Eval-Print Loop) to run your code interactively. This tool will allow you to test new ideas, explore and experiment with new tools and libraries, refactor and debug your code, try out examples, and more.| realpython.com
In this step-by-step tutorial, you'll see common examples of invalid syntax in Python and learn how to resolve the issue. If you've ever received a SyntaxError when trying to run your Python code, then this is the guide for you!| realpython.com
In this tutorial, you'll learn about the Python pass statement, which tells the interpreter to do nothing. Even though pass has no effect on program execution, it can be useful. You'll see several use cases for pass as well as some alternative ways to do nothing in your code.| realpython.com
In this step-by-step tutorial, you'll learn how to read and understand the information you can get from a Python traceback. You'll walk through several examples of tracebacks and see some of the most common tracebacks in Python.| realpython.com
In this tutorial, you'll learn about numbers and basic math in Python. You'll explore integer, floating-point numbers, and complex numbers and see how perform calculations using Python's arithmetic operators, math functions, and number methods.| realpython.com
In Python, a tuple is a built-in data type that allows you to create immutable sequences of values. The values or items in a tuple can be of any type. This makes tuples pretty useful in those situations where you need to store heterogeneous data, like that in a database record, for example.| realpython.com
Master the Python range() function and learn how it works under the hood. You most commonly use ranges in loops. In this tutorial, you'll learn how to iterate over ranges but also identify when there are better alternatives.| realpython.com
In this tutorial, you'll dive deep into Python's lists. You'll learn how to create them, update their content, populate and grow them, and more. Along the way, you'll code practical examples that will help you strengthen your skills with this fundamental data type in Python.| realpython.com
In this tutorial, you'll learn what iterators and iterables are in Python. You'll learn how they differ and when to use them in your code. You'll also learn how to create your own iterators and iterables to make data processing more efficient.| realpython.com
In this tutorial, you'll learn how class constructors work in Python. You'll also explore Python's instantiation process, which has two main steps: instance creation and instance initialization.| realpython.com
Python list comprehensions help you to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this tutorial, you'll learn when to use a list comprehension in Python and how to create them effectively.| realpython.com
Learn how to work effectively with Python sets. You’ll define set objects, explore supported operations, and understand when sets are the right choice for your code.| realpython.com
In this tutorial, you'll learn how to work with Python dictionaries to help you process data more efficiently. You'll learn how to create dictionaries, access their keys and values, update dictionaries, and more.| realpython.com
Learn how to read, process, and parse CSV from text files using Python. You'll see how CSV files work, learn the all-important "csv" library built into Python, and see how CSV parsing works using the "pandas" library.| realpython.com
Join us live for an exclusive members-only Q&A session with the Real Python team. You'll meet fellow Pythonistas to chat about your learning progress, ask questions, and discuss Python tips & tricks via screen sharing. Simply register for upcoming events on this page.| realpython.com
In this guide, you'll learn how to get the most out of your Real Python membership using the community Slack. You'll learn some lesser-known features of Slack and see how to communicate your technical problems more effectively.| realpython.com
In this quiz, you'll test your understanding of the Python Global Interpreter Lock (GIL). The GIL behaves like a mutex that allows only one thread to hold the control of the Python interpreter. This has advantages, but can be a performance bottleneck in CPU-bound and multi-threaded code.| realpython.com
In this tutorial, you'll learn all about object-oriented programming (OOP) in Python. You'll learn the basics of the OOP paradigm and cover concepts like classes and inheritance. You'll also see how to instantiate an object from a class.| realpython.com
In this intermediate-level article, you'll explore the similarities and differences you'll find when comparing Python vs C++. You'll learn about memory management, virtual machines, object-oriented programming differences, and much more!| realpython.com
Learn how to write high-quality, readable code by using the Python style guidelines laid out in PEP 8. Following these guidelines helps you make a great impression when sharing your work with potential employers and collaborators.| realpython.com
This article explores Python modules and Python packages, two mechanisms that facilitate modular programming.| realpython.com
In this tutorial, you'll learn how to create and use full-featured classes in your Python code. Classes provide a great way to solve complex programming problems by approaching them through models that represent real-world objects.| realpython.com
Python's f-strings provide a readable way to interpolate and format strings. They're readable, concise, and less prone to error than traditional string interpolation and formatting tools, such as the .format() method and the modulo operator (%). F-strings are also faster than those tools!| realpython.com
In this beginner tutorial, you'll learn what exceptions are good for in Python. You'll see how to raise exceptions and how to handle them with try ... except blocks.| realpython.com
The Python import system is as powerful as it is useful. In this in-depth tutorial, you'll learn how to harness this power to improve the structure and maintainability of your code.| realpython.com
In this tutorial, you'll learn how to use the development environment included with your Python installation. Python IDLE is a small program that packs a big punch! You'll learn how to use Python IDLE to interact with Python directly, work with Python files, and improve your development workflow.| realpython.com