Here are some tricks, hacks and patterns I like using most while coding Python. I will try to add more when I come across them. Basic One-Liners print [item*2 for item in [1, 2, 3]] # prints: [2, 4, 6] cond = True print 'yes' if cond else 'no' # prints: yes Dynamic Function Arguments def somefunc(self, *args, **kwargs): print 'args: %s' % args print 'kwargs: %s' % kwargs somefunc(1, 2, thirdarg=3)