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 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".
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.
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 4 exercises, the regular price for Python Morsels is $16 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.Sign up now for Python Morsels
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.
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.
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.
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.
For me, there were two obstacles. First, the fee of $16/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.
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.
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.
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.
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.
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!
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.
The tests I provide should run against Python 3.4+ 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.
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.
No problem. Shoot me an email.
My name is Trey Hunner. I am a professional Python 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.
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.Sign up now for Python Morsels
If you find you'd like to stay subscribed after the 4 free exercises, your subscription will be locked in at only $16 per month forever. If I decide to increase the price in the future, I guarantee that your subscription price will remain at $16 per month.