3 ms·
I"d strongly recommend Trey Hunner at PythonMorsels. The approach is to give you a concise problem that should exercise some part of your python knowledge, and
by ghshephard 6y ago
I"d strongly recommend Trey Hunner at PythonMorsels. The approach is to give you a concise problem that should exercise some part of your python knowledge, and have you write code, re-write your code, bang your head against a problem, and then, once you've written something that passes all the unit tests, you get a walk through possible solutions by someone who knows python well.
Trey starts with a description of how you might solve the problem (which is about how I solved the problem 50% of the time) that is almost always clearly wrong, even though it "works" - then he shows you a somewhat more pythonic and modern way - and you go, "aha!", and then, he shows you the elegant solution - and it changes your life, and you use that pattern in everything you write.
His focus though, is really on how to write clean pythonic 3.x code more than the latest and greatest features, but he tags his problems/solution sets, so if you really want to dive into decorators, or context managers, or dunder methods - you can zoom right in.
The only problem I've had with Python Morsels is I look at the code I wrote a year ago (I'm not a developer) and I'm embarrassed and ashamed at how gross it was.