From the book Fluent Python (which you can get from the Humble Bundle right now):
What would the following piece of code do?
- A TypeError is raised because tuples does not support item assignments?
- Both 1. and 2.
The answer is the link, which is quite surprising.
It turns out that
t.extend([50, 60])doesn’t break Python, and this riddle is really a super esoteric corner case…
After installing Python(x,y), I’ve decided to play around with the various modules and applications packaged. The IDE that came with the package (Spyder) is surprisingly useful and feature-rich, which is helping me immensely with visualizing data from my work (in conjunction with the packaged matplotlib). Just yesterday, I’ve decided to dip my hands into the imaging library (PIL) and see what features it has by making a Adele-esque album cover.
I took an old photo of mine, cropped my face out, and placed it on a transparent background using Photoshop. Next, I cropped out Adele’s hand from the album and saved that as a separate image.
Now using PIL, I was able to copy my head and Adele’s hand onto a new image, rotate the said image, and add text to it. It was surprisingly… easy.