lambda function as a list number
L = [(lambda x: x**2), (lambda x: x**3), (lambda x: x**4)] for f in L: print f(2) # prints 4, 8, 16 print L[0](3) # prints 9
1. | Class inside a List | ||
2. | Int, string, function, and list as list element | ||
3. | List items need not all have the same type. |