Question: I've seen some elegant python snippets using list comprehension and map reduce. Can you share some of these code or a web site.

Thanks.

Answer: 
There are some nice functional style snippets in here: [Functional Programming HOWTO](http://docs.python.org/dev/howto/functional)
Be careful when programming python in functional style. The only reason to ever do so is for readability. If the algorithm is more elegantly expressed functionally than imperatively, and it doesn't cause performance problems (it usually doesn't), then go right ahead.

However, python does not optimize tail recursion, and has a fixed recursion limit of 1000, so you generally can't do O(n) recursion, only O(log(n)).

Also, reduce() is removed in python 3, for good reason ( <http://www.artima.com/weblogs/viewpost.jsp?thread=98196> ). Most non-trivial uses of reduce are more readable as a normal loop instead of a reduction, and sum() is already built in.