Use The Underscore in The REPL
You can obtain the result of the last expression in a Python REPL with the underscore operator, e.g. in the Python REPL this looks like: … read more
Start Learning Python Today
You can obtain the result of the last expression in a Python REPL with the underscore operator, e.g. in the Python REPL this looks like: … read more
One of the earliest Python pep’s is PEP-20. It’s a list of 19 theses relating to Python programming called ‘The Zen of Python.’ These rules … read more
The Pillow Python Imaging Library is ideal for image processing. Typically, it’s used for archival and batch processing applications. Of course, you’re free to use … read more
There’s a package for pretty much everything you can think of in the Python ecosystem, all installable with a simple pip command. So it shouldn’t … read more
With this trick, you can quickly convert a Python string to title case. To quote from the Wikipedia article: “Title case or headline case is a style of capitalization used … read more
With this neat little trick, you can swap two Python variables without using a third variable: It’s just one line of code! As you can … read more
Since version 3.7, Python offers data classes. There are several advantages over regular classes or other alternatives, like returning multiple values using a tuple or … read more
Most functions in Python return a value: the result of the work done by that function. But did you know that Python functions can return … read more
With sys.getsizeof() you can check the memory usage of an object: Woah… wait… why is this huge list only 48 bytes? It’s because the range … read more
IPython is basically an enhanced shell. It’s worth it just for the autocompletion alone, but there is much more. I like it too for all the … read more