Why I love Python – Expressiveness

Here is one of those little things that make me love Python:

d = {'a': (1,2), 'b': (3,4)}
for k, (a, b) in d.items():
    print k, a, b

Prints:
a 1 2
b 3 4

How cool is that? 😉

Advertisements