Python Morsels

Coworkers finding your Python code hard to read?

You may know how to write code and you know Python syntax well, but knowing Python syntax is different from writing idiomatic Python code. When writing Python code, it's important to embrace the language constructs given to you: you want to solve problems like a Python programmer, not like a C++, Java, or JavaScript programmer.

Python courses usually focus much more on syntax than programming style. You don't need to learn more about Python's syntax and you don't need to learn about programming in general. To improve your Python programming abilities, you need regular practice embracing a Python-like style of programming.

Imagine if your code felt natural and Pythonic

Imagine if you wrote code like an experienced Python programmer. Imagine if other Python programmers looked at your code and thought "wow that's a very Pythonic solution".

If your Python habits improved, you'd feel much more comfortable calling yourself an "experienced Python developer".

Get hands-on experience with idiomatic Python

Often the most important challenge to writing Pythonic code is deliberate practice. Stop reading about Python code style and start pushing yourself to write Pythonic code.

Sign up for Python Morsels and I'll send you 1 short Python exercise every week. After you attempt to work through the exercise, I'll send you a number of solutions to the exercise with explanations of each one. You'll study these solutions and attempt to re-solve the problem in more Pythonic ways.

Solving problems with Python-specific constructs will encourage you to think Pythonically. It's very important to get feedback on your work by comparing to and learning from more idiomatic code.

Each exercise will include automated tests and some may include bonuses for a little more of a challenge.

Ready to improve your Python skills?

Are you ready to get practice writing high quality Python code every week?

Great! The first 4 Python Morsels exercises are free and you don't need to enter payment information to sign up.

If you want to keep receiving an exercise every week after the first 5 exercises, the regular price for Python Morsels is $20 per month. That's about the price of the pots of tea you'll drink each month while you solve each exercise.

Salaries, incomes, and financial situations for Python users vary greatly, especially on an international level. I offer discounts on Python Morsels in an attempt to compensate for this inequity. You can find my standard discounts for Python Morsels on the discounts page.

Get a free month of Python Morsels

100% money back guarantee

I'm pretty certain that if you actually work through the exercises I send you each week and reflecting upon the solutions I send you will improve your Python skills. If you feel you haven't been getting your money's worth after the first month of Python Morsels, just let me know and I'll refund your first month's payment in full.

Don't take my word for it

Below is genuine (and hopefully honest) feedback from current and past Python Morsels users. This is just some of the feedback I've saved from Python Morsels users. You can find even more things people say about Python Morsels on this testimonials page.

Matt Lakin

I'm 17 exercises in, and I am still absolutely loving Python Morsels. The way it's structured with the base problems, bonus problems, the links to forum posts as hints, and the way the Wednesday solution walks you through the thought process and iterates over different solutions is just perfect. The difficulty level so far has been hitting a nice sweet spot, where I've been able to solve the base and sometimes a few bonus steps on my own, and the rest with your hint links, and then finally when I get the solution it validates some of my choices and thought process, and teaches me some different and usually more elegant or clever ways to approach the problems.

Jeannie Friedel

I love these. They are short and simple enough that I can do them in between putting my daughters to bed, but challenging enough that I learn something new almost every time. Of course there is always a long - probably unpythonic - way to solve most problems, but I push myself, not to make it short, but to make it readable, clear, and pythonic. It's great to be able to try different stuff out that I may not use every day because I'm just not comfortable with it. I usually get more out of the bonuses than the main exercise, but I absolutely LOVE having the automated tests.

Keith O'Sullivan

Thanks for the great exercise this week. I really appreciate the thought that goes into defining and testing these exercises. I was happy enough when I finished the basic challenge (still trying to wrap my head around iterators). But when I pulled off both challenges and managed to edit my code down to 7 lines, I got pretty excited. I seem to learn more each week for the couple of hours that I spend on these than the rest of the week combined.

Rosie Highsmith

Python Morsels has given me a clear understanding of how to approach core concepts of programming in Python. It's the perfect mix of familiarity and new ideas as Trey's explanations are both methodical and engaging.

Volker Englisch

Overall I have to admit that I'm blown away by the usefulness of your weekly exercises. There is nothing academic about them and they seem to be applicable to many situations. In addition, the exercises are simple enough to follow the basic concepts while the bonus sections provide depth to keep me busy for the week. Thanks again for your great training!

Larry Marek

I wasn't sure this was the sort of thing I wanted to get involved in. I've done just one exercise so far, and I have to say it was much better than I had thought it'd be. It was a nice amount of code - enough to need some thought, not too much to get over involved. At first I'd thought the exercise would be some "cute" problem with little real-world use, but it turned out to be a very useful thing. I'm an old retired guy learning Python just for the fun of it, so the primary benefit to me is that it forces me to really write some code on a regular basis. Following book exercises are usually too canned. I also like that Trey proposes various solution hints in mid-week. Also, it's good to compare my solution with an expert. My solution may work, but it doesn't always really do it "the Python way". I would recommend PM to anyone that wants to get some practice coding in Python. I do wish there was a forum everyone could post their code. It's good to see Trey's solution, but it would be even better to see a variety of solutions.

Still need more thoughts from users? Read more feedback here

Have questions?

» What kind of time commitment does this require?

I expect you to schedule 30 minutes in your calendar every week to solve the exercises and 30 minutes to review my solutions to the exercises. You're welcome to spend more time on the bonuses I send, but I don't want you to go overboard. Small regular time blocks are much more effective for learning than large rare time blocks.

» How are these exercises any more valuable than exercises on websites like Hacker Rank and Project Euler?

My exercises encourage learning specific Python skills much more so than the exercises on Hacker Rank, Project Euler, and Code Wars. Most exercise websites don't focus on specific language features so much as general problem solving skills, while my exercises are specifically meant to help you improve your understanding of Python's many features (things like multiple assignment, comprehensions, and generators). I also provide a detailed walk-through of many different solutions for each exercise I send, which is something you won't find on any of the popular exercise sites.

» Do I really need to be well versed in advanced Python features to solve these exercises?

You definitely don't need to know advanced python features. Knowing the basics should actually be good enough. If you're already familiar with many of Python's more unique features (like zip, comprehensions, or generators) you'll get some great practice applying them and learning even more of them!

» Should I sign up if I don't know how to code yet?

No you probably should not sign up if you don't know how to code yet. I suggest signing up for a programming course before you start practicing these exercises every week.

» Do you offer team plans so I can offer this to my team?

I'm doing this on a case-by-case basis right now.

I'd love to chat with you about what your team needs. Please email me.

» What if these exercises aren't the right difficulty level for me?

This is an important question. There's now a feature into Python Morsels to address it: skill level selection. After sign-up you can choose from novice, intermediate, or advanced skill levels. You can find a description of what each skill level includes here. I don't want you to stress about this too much though because I set a default skill level that's a pretty decent in-between and you can always change your skill level later.

» What version of Python does this require?

The tests I provide should run against Python 3.5+ but I'll be using the latest version of Python in my exercise answers. You can use whatever version of Python you'd like, but your solutions may look quite different from mine if you're on a considerably older version.

» What happens after I subscribe?

Right after you sign up, you'll get an email instructing you to reserve time in your calendar. Next Monday you'll get your first exercise including automated tests to use when you solve it. Two days later you'll get a number of solutions to the exercise with explanations of each solution and a discussion of which solution is the most Pythonic.

» I still have questions!

No problem. You may want to check the FAQ page in the Python Morsels knowledge center. If your question doesn't seem to be on this page or the FAQ page, please shoot me an email.

Exercises curated by a professional Python trainer

My name is Trey Hunner. I am a professional Python team trainer specializing in on-site training for Python & Django teams.

My training sessions are very hands-on. I spend quite a bit of time creating short, testable, realistic exercises for my courses and workshops. I've created this Python Morsels subscription service to share my favorite exercises with you.

Commit to practicing Python every week

Why wait to build your mastery of Python best practices?

If you don't devote time to improving your Python skills regularly, you might stay a beginner forever. Start your journey of writing beautiful well-structured Python code today.

Get 4 weeks of Python Morsels for free

Lock in your subscription price now

If you find you'd like to stay subscribed after the 4 free exercises, your subscription will be locked in at only $20 per month forever. If I decide to increase the price in the future, I guarantee that your subscription price will remain at $20 per month.