Practice Python

Beginner Python exercises

28 May 2016

About

What is Practice Python

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.

Exercises

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.

Solutions

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.

Follow along

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:

  1. Add this blog to your Feedly feed, by clicking on the link in the top right corner of the page, or clicking here. follow us in feedly
  2. If you don’t have Feedly but use some other RSS reader, add this blog to your RSS reader by clicking the RSS icon in the top right corner of the page, or click here. Atom feed XML
  3. Sign up for the Practice Python email list and get emailed once in a while: new exercises, solutions, blog posts, and occassional special promotions.

About the author

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.

A picture of me

Getting in touch

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.

Getting started

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.

Enjoying Practice Python?


Explore Yubico
Explore Yubico
comments powered by Disqus