Python Practice: 91 Exercises, Projects, and Tutorials
This guide gives you 91 ways to practice Python — from quick exercises to real projects and helpful courses. Whether you’re a beginner or preparing for a job, there’s something here for you.
Table of Contents
Hands-On Courses
Some Python programming courses let you learn and code at the same time. You read a short lesson, then solve a problem in your browser. It’s a fast, hands-on way to learn.
Each course below includes at least one free lesson you can try.
Python Basics Courses
Data Analysis & Visualization Courses
Data Cleaning Courses
Machine Learning Courses
- Intro to Supervised Learning
- Intro to Unsupervised Learning
- Linear Regression Modeling
- Gradient Descent Modeling
- Logistic Regression Modeling
- Decision Trees & Random Forests Modeling
- Optimizing ML Models
AI & Deep Learning Courses
Probability & Statistics Courses
These courses are a great way to practice Python online, and they're all free to start. If you're looking for more Python courses, you can find them on Dataquest's course page.
Free Python Exercises
Exercises are a great way to focus on a specific skill. For example, if you have a job interview coming up, practicing Python dictionaries will refresh your knowledge and boost your confidence.
Each lesson is free to start.
Beginner Python Exercises
- Basic mathematical operators — Use Python to perform calculations and printing results to the screen.
- Variables and data types — Work with variables and doing calculations with variables.
- Lists and loops — Practice using Python lists and for loops.
- Dictionaries 1 — Use dictionaries in Python.
- Dictionaries 2 — More practice with dictionaries and frequency tables.
- Lists — Practice using lists in Python.
- Conditional statements (if-else) — Use conditional statements in Python.
- Sets — Practice using sets in Python.
Intermediate Python Programming
- Python functions — Define and call functions.
- Intermediate Python functions — Practice more advanced usage of functions like returning multiple values.
- Object oriented programming (OOP) — Define classes, methods, and attributes.
Data Handling and Manipulation with NumPy
- Index selection — Select values from ndarrays.
- Creating ndarrays — Create ndarrays with specific values and shapes.
- Ndarray methods — Use ndarray methods to perform calculations.
- Broadcasting — Work with ndarrays with different shapes and using broadcasting to create ndarrays.
- Boolean masks — Select data from ndarrays using boolean masks
- Datatypes — Work with NumPy datatypes
- Sorting — Practice sorting ndarrays
- Stacking and splitting — Stack and split ndarrays
Data Handling and Manipulation with pandas
- Pandas series — Use and build pandas series.
- Creating and manipulating dataframes — Create and manipulate pandas dataframes.
- Selecting data with pandas — Select data from dataframes.
- Loading and exploring data — Load data into dataframes and explore it.
- Pandas boolean masks — Use boolean masks to select data from dataframes.
- Pandas data cleaning — Clean data in a dataframe.
Data Analysis
- Cleaning and preparing data — Write functions to remove incorrect characters and fill missing values.
- Data analysis basics — Manipulate data from CSV files using Python dictionaries and functions.
- Working with dates and times — Practice with the datetime module in Python.
Complexity and Algorithms
- Time complexity of algorithms — Identify the type of time complexity of Python functions.
- Constant time complexity — Find the constant time complexity of functions.
- Logarithmic complexity — Practice finding the logarithmic time complexity of functions.
- Sorting algorithms — Create and work with sorting algorithms in Python.
- Space complexity — Practice space complexity by writing Python functions.
- Explore our full library of Python practice problems to continue improving your skills.
Python Projects
Projects are one of the best ways to practice Python. Doing projects helps you remember syntax, apply what you’ve learned, and build a portfolio to show employers.
Here are some projects you can start with right away:
Beginner Projects
- App Market Analysis (free) — Analyze historical data to see which apps attract the most users.
- Word Guessing Game (free) — Create an interactive word-guessing game in Python.
- Garden Simulator Game (free) — Build a text-based game using object-oriented programming and randomness.
- Food Ordering App — Create a simple, interactive food ordering app with Python.
Data Analysis Projects
- Movie Ratings Analysis (free) — Check for bias in movie ratings data.
- Hacker News Data (free) — Analyze Hacker News posts with Python string handling and data management.
- eBay Car Sales — Work with scraped car sales data using Python.
- Traffic Analysis on I-94 — Visualize traffic data using pandas and Jupyter Notebook.
- Exchange Rate Visualizations — Create multiple plots to tell a story with data.
- Employee Exit Surveys — Analyze survey data to answer stakeholder questions.
- NYC High School SAT Analysis — Explore SAT performance by demographics using scatter plots and maps.
Data Engineering Projects
- Fast CSV Queries (free) — Build an inventory system with efficient Python data structures.
- Wikipedia Data Analysis (free) — Search and process large datasets using Python and MapReduce.
- Crime Reports Database — Build a PostgreSQL database with proper tables and schemas.
Machine Learning & AI Projects
- Predict Heart Disease (free) — Build a model to predict patient risk.
- Predict Insurance Costs — Use Python linear regression to estimate insurance costs.
- Dynamic AI Chatbot — Create a chatbot that can track conversation history and switch personas.
If none of these spark your interest, there are plenty of other Python projects to try.
Online Python Tutorials
If exercises, courses, or projects aren’t your thing, blog-style tutorials are another way to learn Python. They’re great for reading on your phone or when you can’t code directly.
Core Python Concepts (Great for Beginners)
- Strings
- Dictionaries
- Data Structures
- Classes
- Lists
- If Statements
- Complete Python Guide — A collection of tutorials, practice problems, cheat sheets, guided projects, and FAQs.
Intermediate Techniques
Data Analysis & Data Science
- Reset Index in pandas
- GroupBy in pandas
- Getting Started with APIs
- Introduction to Keras
- Support Vector Machines (SVMs)
- NumPy, pandas & Data Visualization Guide — A collection of tutorials, practice problems, cheat sheets, guided projects, and FAQs.
- Data Cleaning Guide — A collection of tutorials, practice problems, cheat sheets, guided projects, and FAQs.
The web is full of thousands of beginner Python tutorials. Once you know the basics, you can find endless ways to practice Python online.
FAQs
Where can I practice Python programming online?
- Dataquest.io: Offers dozens of free interactive practice questions, lessons, project ideas, walkthroughs, tutorials, and more.
- HackerRank: A popular site for interactive coding practice and challenges.
- CodingGame: A fun platform that lets you practice Python through games and coding puzzles.
- Edabit: Provides Python challenges that are great for practice or self-testing.
- LeetCode: Helps you test your skills and prepare for technical interviews with Python coding problems.
How can I practice Python at home?
- Install Python on your machine.
You can download Python directly here, or use a program like Anaconda Individual Edition that makes the process easier. If you don’t want to install anything, you can use an interactive online platform like Dataquest and write code right in your browser.
- Work on projects or practice problems.
Find a good Python project or some practice problems to apply what you’re learning. Hands-on coding is one of the best ways to improve.
- Make a schedule.
Plan your practice sessions and stick to them. Regular, consistent practice is key to learning Python effectively.
- Join an online community.
It's always great to get help from a real person. Reddit has great Python communities, and Dataquest's Community is great if you're learning Python data skills.
Can I practice Python on mobile?
Yes! There are many apps that let you practice Python on both iOS and Android.
However, mobile practice shouldn’t be your main way of learning if you want to use Python professionally. It’s important to practice installing and working with Python on a desktop or laptop, since that’s how most real-world programming is done.
If you’re looking for an app to practice on the go, a great option is Mimo.
With AI advancing so quickly, should I still practice Python?
Absolutely! While AI is a powerful support tool, we can’t always rely on it blindly. AI can sometimes give incorrect answers or generate code that isn’t optimal.
Python is still essential, especially in the AI field. It’s a foundational language for developing AI technologies and is constantly updated to work with the latest AI advancements.
Popular Python libraries like TensorFlow and PyTorch make it easier to build and train complex AI models efficiently. Learning Python also helps you understand how AI tools work under the hood, making you a more skilled and knowledgeable developer.