Functional Python ================= Python is known to be a multiparadigm language. This means that it borrows some elements from many programming disciplines --- functional, imperative, object oriented, etc. Few people use these methods, however. I, for one, gladly wrote `for` loops, when I could have written `map`. I wrote a few lines of code, but did not use list comprehension. This programming style was not because I did not know how to program in python, rather they were because I did not know much about functional programming. Take the following program, for example: --------------------------------- def fun1(x): return x + 3 def fun2(x): return x * 3 def zero_matrix(size): matrix = [] for i in xrange(size): matrix.append([]) for j in xrange(size): matrix[i].append(0) return matrix --------------------------------- This is how you would write a program in C/C++/Java/C#. They can be easily translated to all these languages; the `zero_matrix` function, for example, can be written in Java code as (bear in mind that I am not a Java programmer): --------------------------------- ArrayList zero_matrix(int size) { ArrayList matrix = new ArrayList(); ArrayList tmp; for(int i = 0; i( ); for(int j = 0; j