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.

If you are a student, live in a country outside of the top 50 by GDP, or have a financial hardship, contact us about our discounts.

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

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!

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.

Sjoerd Job Postmus

Three of our developers are doing Python Morsels. My biggest concern when signing up for Morsels was the time-involvement. Would it not cost too much time from my development team? The purchase was definitely worth it. The challenges provided by Python Morsels are practical and relevant for the working software developer. The automated tests assure you're not only solving a problem, but know that it works. The solution e-mail provides a very thorough reasoning behind the chosen implementations. Also the weekly challenges are fun! I would definitely recommend Python Morsels to others. It's a lot of fun, and includes very practical information. Thank you for providing us with the weekly Morsels, Trey. They're well worth it.

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.

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.

Eric Vanhove

I was just finishing off catching up on some morsels when the second month's bill came in. Got to admit, when I signed up I was thinking "I'm not sure if this is worth $4 a week..." When I saw the bill (and I had literally just run the tests and got the lovely "OK"). My first thought was "yeah, I'm glad I'm spending this $4 a week." So, thanks!

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.

Saurav R. Tuladhar

For me, there were two obstacles. First, the fee of $20/mo. I knew it was not a substantial amount to me, but still I had to make a mindful commitment rather than some mindless spending. It was a mental obstacle I had to overcome. Second, I was concerned that the morsels would involve only basic Python and so my Python skills would not be pushed beyond what I have now. But now after more than 3 months of Python Morsels, I genuinely feel an improvement. The purchase was worth it down to every cent. Not only in terms of the money, but also in terms of the time put in towards working on the weekly morsels. It's a form of weekly deliberate practice to improve my Python skills. It makes me think about the underlying structure of the Python language. I realized that there are multiple ways a problem can be solved using Python. Also I find the unittests provided by Trey very helpful.

I would recommend Python Morsels to anyone looking to improve their Python skills. I have learned and actually implemented new Python skills after following Python Morsels compared to learning through a tutorial. Unlike following through a tutorial on a specific Python topic or feature, the weekly problem format follows an 'active learning' approach where one is encouraged to think in a Pythonic way. Moreover the solutions provided by Trey exhibits a multitude of ways in which the particular problem could be solved. I find reading it highly insightful going through Trey's solutions where he presents both why and how a particular solution works.

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.

Kumar Pradeep

The only challenging factor for me was money because at that time I was struggling to get a job. I am coding regularly. I was spending hours on it, even for simple tasks. While solving morsels exercises, I realize often more things, and hence my search becomes more and more exhaustive and more productive, and that my friends, has increased my knowledge and learning. Most of it is difficult for me as I am not from any programming background, so in a way, I am learning things from very scratch. For me, every challenge is unique in a way. Whenever I solve a problem, It's completely new, hence completing it from start to end gives me a lot of confidence. With Python Morsels, you become disciplined, aggressive, and your confidence level goes up. I would recommend this because there is definitely something for everyone. I have never seen in my real life experience, the problems which I have solved, but I think it's worth a shot. It is a great thing, at least it was a boon to me.

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. Shoot me an email me.

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.