Practice Python was created as a side project to provide small, short, and relevant introductory Python programming exercises for beginners. When I worked for MEET as a computer science instructor, I had a hard time finding Python exercises that were small, self-contained, and suited for beginners. Many resources online, while thorough, were partially inaccessible to complete beginners. Mainly, the exercises were given without context. I recognized many of the problems as arbitrary and distinctly computer-sciency. They were all about sorting lists, class-design of different kinds of students, and searching through lists of strings. I wanted to provide easier problems that were more relevant to someone interested in learning Python or programming in general. Long-term, I want to provide Python resources for learners and educators alike - Practice Python is the first step. Read more at Why Practice Python.
Practice Python is written and maintained by me, Michele Pratusevich (personal site, github profile). The blog is roughly monthly, with an exercise that comes out one week and a solution for that exercise that comes out the next week. As I experiment with this site over time, the frequency might become more or less frequent. If you have opinions, please feel free to let me know!
In each exercise post, I will post a small tidbit of Python 3 (an explanation, a library, a sample function) and pose an exercise that relates to the explanation / sample written in the post. The exercise should take no more than 30 minutes to solve and test. I will also try to include links to external websites that explain concepts in a simple way. The exercises will vary in difficulty from week to week. Check out the explanation of the chili difficulty system for more information.
Prior to 2021, I had included user-submitted solutions to exercises (the first 30 or so have them), but I stopped collecting them because it was a lot to go through! Instead, I write up my own solutions in the solution pages. You can check your solution against the posted solution on the solution page and discuss in the comments. At this time we cannot critique your solutions - if this is something of interest to you please email us to get in touch.
If you like the idea of Practice Python, want to do the exercises, or just want to get notified about a new exercise or post, you have a few options:
My name is Michele Pratusevich, and in my day job I am a research engineer. This means I do a combination of research and engineering, mostly for computer vision problems. I use Python daily, and constantly am looking for interesting Python tidbits and tricks. If you want to learn more about me, check out my personal site. Previously, I got my bachelor of science and master’s of engineering from MIT in Electrical Engineering and Computer Science.
I welcome any and all feedback about the site. Are exercises too easy? Do you want to interact with other readers? Do you want to interact with ME? Please get in touch with me via email - practicepythonsite@gmail.com. I will get back to you as soon as I can. If you are a teacher and interested in using the exercises in the classroom, go right ahead! All the exercises are published under the CC-BY-4.0 license. If you do, I would love to hear your experience and incorporate any feedback.
Ready to get started? Start with Exercise 1, or visit our resources for learners page to find Python books, courses, and online resources to help you along your journey.