Giving life-long learners a low-stress way to hone their #Python skills. 🐍🍪 Write beautiful code. ✨ Made by @treyhunner 💖

Joined January 2018
Python Morsels retweeted
The #Python Morsels lifetime access sale ends tomorrow. ⏰ If you enjoy my teaching style and you plan to use Python frequently during the next few years, consider getting lifetime access to @PythonMorsels. 🐍💖 pym.dev/lifetime
5
3
2,992
Python Morsels retweeted
I'm doing something I've never done: I'm offering lifetime access to #Python Morsels. ♾️ You can get access to all screencasts, articles, and exercises I publish for the price of a 2 year subscription. 🐍 This sale ends on November 27, 2023 💸 pythonmorsels.com/lifetime-a…
1
2
9
1,491
Python Morsels retweeted
I've been running a #Python programming exercise service for nearly 6 years. Here's my advice for how to go about solving a #programming exercise to minimize time and maximize effective learning. pym.dev/programming-exercise…
5
14
1,726
Python Morsels retweeted
If you have a #Python Morsels subscription, check your email! 💌 I sent you a preview of this year's Cyber Monday sale with an extra subscriber discount. If you're not a @PythonMorsels subscriber yet, get my newsletter to hear the announcement soon! 💸 pym.dev/newsletter
1
7
1,237
"In Python, empty objects are falsey. For objects that have a length, if their length is greater than zero, they're considered truthy. And objects with a length equal to zero are falsey." #Python 🪞🐍 pythonmorsels.com/truthiness…
1
10
11
"Whenever you call a class, #Python will construct a new instance of that class, and then call that class' __init__ method" 🐍🆕 pythonmorsels.com/what-is-in…
9
18
Dunder (__dunder__) methods act as a contract between the #Python interpreter and the person who made a particular Python class. Operators, built-in functions, and some special syntaxes are all powered by dunder methods. pythonmorsels.com/topics/wha…
11
15
"Iterables might not have a length and you might not be able to index them. They might not even be finite (there are infinitely long iterables in Python)!" #Python pythonmorsels.com/iterable/?…
6
16
2,087
Python Morsels Lite subscribers get a new screencast recommendation every week and a new #Python exercise every month. It's just $14/month. Sign up to try out a few free exercises and decide whether it's right for you. pym.dev/watch-python-screenc…
3
6
1,730
Reading tracebacks is just part of the process of writing Python code. 📗 Whenever #Python encounters an unhandled exception in your code, it'll print out a traceback. 🐞 pythonmorsels.com/reading-tr…
11
21
"Thanks to duck typing, any object that can be looped over with a for loop or with a comprehension can also be looped over with the built-in list constructor: an iterable is an iterable." pym.dev/using-list/?utm_camp…
1
5
14
2,999
3 minute screencast on how to write a "for loop" in Python: pythonmorsels.com/topics/wri… Unlike traditional C-style "for loops", #Python's "for loops" don't have indexes (and it's a best practice to avoid reaching for indexes unless you really need them).
10
15
Python's data structures don't contain objects; they contain pointers to objects 😮🐍 This screencast contains an odd proof of this: >>> x = [] >>> x.append(x) >>> x[0][0][0][0][0] is x True pythonmorsels.com/topics/dat…
6
16
Define a __repr__ on all your classes. All #Python objects should have a nice string representation. You'll rarely want to define a __str__ method. pythonmorsels.com/topics/cus…
1
8
1
23
Is your #Python program printing out a traceback? You have an uncaught exception! You can catch that exception with a try-except block. trey.io/qQDGls
"If we run our #Python file from the command line, __name__ will be the string __main__. " pym.dev/making-main-function…
7
16