For Python basics, I have to anti-recommend Shaw’s ‘learn the hard way’; it’s generally outdated and in some places actively misleading. And why would you want to learn the hard way instead of the best way in any case?
Instead, my standard recommendation is Al Sweigart’s Automate the Boring Stuff and then Beyond the Basic Stuff (both readable for free on inventwithpython.com, or purchasable in books); he’s also written some books of exercises. If you prefer a more traditional textbook, Think Python 2e is excellent and also available freely online.
Strong agree with not using “the hard way.” Not a big fan.
Automate the Boring Stuff isn’t bad. But I think the best, direct-path/deliberate practice resource for general Python capability is Pybites (codechalleng.es) + Anki. There are 300-400 exercises (with a browser interpreter) that require you to solve problems without them handholding or instructing you (so it’s like LeetCode but for actual programming capability, not just algorithm puzzles). Everything requires you to read documentation or Google effectively, and they’re all decent, realistic use cases. There are also specific paths (like testing, decorators & context management, etc.) that are covered in the exercises.
My procedure:
Finish at least the Easy and at least half the Mediums for each relevant path.
If you learned something new, put it into Anki (I put the whole Pybite into a card and make a cloze-completion for the relevant code—I then have to type it for reviews).
Finish the rest of the Pybites (which will be an unordered mix of topics that includes the remaining Mediums and Hards for each of the learning paths, plus miscellaneous).
IMO, you will now actually be a solid low-intermediate Python generalist programmer, though of course you will need to learn lots of library/specialty-specific stuff in your own area.
For Python basics, I have to anti-recommend Shaw’s ‘learn the hard way’; it’s generally outdated and in some places actively misleading. And why would you want to learn the hard way instead of the best way in any case?
Instead, my standard recommendation is Al Sweigart’s Automate the Boring Stuff and then Beyond the Basic Stuff (both readable for free on inventwithpython.com, or purchasable in books); he’s also written some books of exercises. If you prefer a more traditional textbook, Think Python 2e is excellent and also available freely online.
Thanks! I learned Python ~10 years ago and have no idea what sources are any good lol. I’ve edited the post with your recs :)
Strong agree with not using “the hard way.” Not a big fan.
Automate the Boring Stuff isn’t bad. But I think the best, direct-path/deliberate practice resource for general Python capability is Pybites (codechalleng.es) + Anki. There are 300-400 exercises (with a browser interpreter) that require you to solve problems without them handholding or instructing you (so it’s like LeetCode but for actual programming capability, not just algorithm puzzles). Everything requires you to read documentation or Google effectively, and they’re all decent, realistic use cases. There are also specific paths (like testing, decorators & context management, etc.) that are covered in the exercises.
My procedure:
Finish at least the Easy and at least half the Mediums for each relevant path.
If you learned something new, put it into Anki (I put the whole Pybite into a card and make a cloze-completion for the relevant code—I then have to type it for reviews).
Finish the rest of the Pybites (which will be an unordered mix of topics that includes the remaining Mediums and Hards for each of the learning paths, plus miscellaneous).
IMO, you will now actually be a solid low-intermediate Python generalist programmer, though of course you will need to learn lots of library/specialty-specific stuff in your own area.