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 some elegant code". When new developers joined your team, they'd look to code you'd written as an example of how to write maintainable Python code.

When you look back on code you wrote 6 months ago, you may think "I could have done that better" but you'll also think "that's some pretty readable code". You'll be proud of your old code!

Every programming language is different: being an experienced programmer isn't the same as being an experienced Python programmer. If your Python habits improved, you'd feel much more comfortable referring to your yourself as an "experienced Python developer".

Get hands-on experience writing idiomatic Python

You can't write more Pythonic code without writing more Python code. To improve, you need to stop reading about Python code style and start pushing yourself to improve your Python skills through deliberate practice.

Sign up for Python Morsels and I'll send you 1 short Python exercise every week. Each exercise includes a base problem, bonuses, hints, and automated tests. You can submit your solution through the website to track your progress and challenge yourself to see how complete you can make your answer.

A couple days after I send you the problem each week, I'll send various solutions to the exercise with detailed explanations of what makes each solution better or worse than the others. You can then study these solutions, wait a day or two, and attempt to re-solve the problem again in one or more new ways that you've just learned about.

Solving problems with Python-specific constructs will encourage you to think Pythonically and comparing your code style to idiomatic code will allow you to self-assess your code style.

These aren't your typical programming exercises

The most obvious difference between Python Morsels and other programming exercise sites is a focus on Python coding and Python code style: Python Morsels is not a general-purpose programming service.

Python Morsels focuses on reflecting on the code you've written.

With Python Morsels I won't just ask you to solve exercises and then leave you wondering whether you could have written a better solution. After you attempt each exercise, you'll see a detailed analysis of many different ways to solve the problem. We'll discuss what makes one solution better than another and at the end you'll have a sense for which solution I personally prefer most and why I think it's the best one. You won't find this kind of detailed solution breakdown in other Python exercise services.

Python Morsels exercises are:

  • Not focused on clever coding or low-level algorithmic tricks
  • Similar to real world problems (mostly): you might actually write code like this
  • Not very mathematically-oriented (this isn't Project Euler)
  • Focused on reflection: it's important that you reflect on the various solutions each week
  • Layered: each exercise has a few layers of "oh yeah, that Python feature!"
  • Not programming interview questions (they're not just C code written in Python)
  • For folks familiar with Python: even the novice level assumes comfort with Python's syntax

Ready to improve your Python skills?

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

Great! The first month of Python Morsels is free and no payment details are needed to sign up. All you need to do to signup is enter your email and then set your password (upon confirming your email). You'll immediately get your first exercise after signup, at which point you can choose your desired skill level (novice, intermediate, advanced).

If after one month, you want to keep receiving an exercise every week, you can enter your payment details to continue your subscription for $20 per month or $200 per year.

Financial situations vary greatly for Python users around the world so I offer discounts to compensate for this natural inequity. If you end up falling in love with Python Morsels but $20/month is too much for your budget, you can request a discount based on your income level.

Get a free month of Python Morsels

100% money back guarantee

I want to make sure you get your money's worth from Python Morsels. I don't want you paying me more money than the value you get out of this service.

I'm pretty certain that if you actually work through the exercises each week and reflect on the solutions 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.

More than that, if you start paying me and many months into paying for Python Morsels you realize that 1 or 2 of the exercises you've been sent in the last month aren't up to the standards you've come to appreciate in Python Morsels, I'd like you to contact me and ask for an appropriately-sized refund.

If you don't feel comfortable asking for a refund, then at least contact me and ask if I can send you another exercise to make up for the subpar exercise(s) you've recently received. Feel free to screenshot this paragraph and email it to me to explain your request (though no explanation will be needed, as I have already offered partial refunds for dud Python Morsels exercises). If and when I send you an exercise that isn't up to your learning standards, contact me. I'll do whatever I can to remedy the situation.

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 less regular 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.6+ 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?

You can read lots of blogs and books on Python code style, but those resources aren't going to stick in your mind unless you find a way to apply that knowledge. You don't learn by putting information into your head: you learn by trying to retrieve information from your head.

If you don't devote time to improving your Python skills regularly, you'll likely stay at your current experience level for a long time. Regardless of where you are in your learning journey, the best way to write more beautiful and well-structured Python code is through deliberate practice. Instead of inventing your own curriculum to keep improving every week, let me help you. I'm constantly improving the order the exercises I send and the topics I teach so that you don't have to worry about what Python features to practice next: I'll do that part for you.

Try out Python Morsels and see what you think.

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.