Python for Loops: The Pythonic Way
Feb 03, 2025 intermediatebest-practicespython
In this tutorial, you'll learn all about the Python for loop. You'll learn how to use this loop to iterate over built-in data types, such as lists, tuples, strings, and dictionaries. You'll also explore some Pythonic looping techniques and much more.
Top Python Game Engines
Feb 02, 2025 basicsgamedev
In this tutorial, you'll explore several Python game engines available to you. For each, you'll code simple examples and a more advanced game to learn the game engine's strengths and weaknesses.
Build a Dice-Rolling Application With Python
Feb 02, 2025 basicsprojects
In this step-by-step project, you'll build a dice-rolling simulator app with a minimal text-based user interface using Python. The app will simulate the rolling of up to six dice. Each individual die will have six sides.
Develop Data Visualization Interfaces in Python With Dash
Feb 02, 2025 intermediatedata-sciencedata-viz
In this tutorial, you'll learn how to build a dashboard using Python and Dash. Dash is a framework for building data visualization interfaces. It helps data scientists build fully interactive web applications quickly.
Build a Quiz Application With Python
Feb 02, 2025 basicsprojects
In this step-by-step project, you'll build a Python quiz application for the terminal. Your app will ask you multiple-choice questions that you can use to strengthen your own knowledge or challenge your friends to test theirs.
Providing Multiple Constructors in Your Python Classes
Feb 01, 2025 intermediatepython
In this step-by-step tutorial, you'll learn how to provide multiple constructors in your Python classes. To this end, you'll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods.
Python & APIs: A Winning Combo for Reading Public Data
Feb 01, 2025 intermediateapi
In this tutorial, you'll learn what APIs are and how to consume them using Python. You'll also learn some core concepts for working with APIs, such as status codes, HTTP methods, the requests library, and much more. You'll also see a few examples of real-life APIs and how to consume them.
Natural Language Processing With spaCy in Python
Feb 01, 2025 intermediatedata-science
In this step-by-step tutorial, you'll learn how to use spaCy. This free and open-source library for natural language processing (NLP) in Python has a lot of built-in capabilities and is becoming increasingly popular for processing and analyzing data in NLP.
A Guide to Modern Python String Formatting Tools
Feb 01, 2025 basicspython
In this tutorial, you'll explore Python's modern string formatting tools. You'll learn how to harness the power of Python's f-strings and the .format() method for string interpolation and formatting.
Build a Tic-Tac-Toe Game With Python and Tkinter
Feb 01, 2025 intermediategamedevgui
In this step-by-step project, you'll learn how to create a tic-tac-toe game using Python and the Tkinter GUI framework. Tkinter is cross-platform and is available in the Python standard library. Creating a game in Python is a great and fun way to learn something new and exciting!
Office Hours
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.
Split Your Dataset With scikit-learn's train_test_split()
Jan 29, 2025 intermediatedata-sciencemachine-learningnumpy
In this tutorial, you'll learn why splitting your dataset in supervised machine learning is important and how to do it with train_test_split() from scikit-learn.
How to Split a Python List or Iterable Into Chunks
Jan 27, 2025 intermediatepython
This tutorial provides an overview of how to split a Python list into chunks. You'll learn several ways of breaking a list into smaller pieces using the standard library, third-party libraries, and custom code. You'll also split multidimensional data to synthesize an image with parallel processing.
Python's Mutable vs Immutable Types: What's the Difference?
Jan 26, 2025 intermediatedata-structurespython
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.
Python's "in" and "not in" Operators: Check for Membership
Jan 26, 2025 basicsbest-practicespython
In this tutorial, you'll learn how to check if a given value is present or absent in a collection of values using Python's in and not in operators, respectively. This type of check is known as membership test in Python.
Lists vs Tuples in Python
Jan 26, 2025 basicspython
In this tutorial, you'll learn the key characteristics of lists and tuples in Python, as well as how to define and manipulate them. When you're finished, you'll have a good feel for when to use a tuple vs a list in a Python program.
Python's zipfile: Manipulate Your ZIP Files Efficiently
Jan 26, 2025 intermediatepython
In this guided tutorial, you'll learn how to manipulate ZIP files using Python's zipfile module from the standard library. Through hands-on examples, you'll learn how to read, write, compress, and extract files from your ZIP files quickly.
Python Folium: Create Web Maps From Your Data
Jan 26, 2025 intermediatedata-sciencedata-viz
You'll learn how to create web maps from data using Folium. The package combines Python's data-wrangling strengths with the data-visualization power of the JavaScript library Leaflet. In this tutorial, you'll create and style a choropleth world map that shows the ecological footprint per country.
Python and TOML: New Best Friends
Jan 25, 2025 intermediatedata-structures
TOML is a configuration file format that's becoming increasingly popular in the Python community. In this tutorial, you'll learn the syntax of TOML and explore how you can work with TOML files in your own projects.
Executing Python Scripts With a Shebang
Jan 25, 2025 intermediatebest-practices
In this tutorial, you'll learn when and how to use the shebang line in your Python scripts to execute them from a Unix-like shell. Along the way, you'll run custom scripts written in your domain-specific language interpreted by Python.