a = [makeFun(i) for i in range(10)]
b = [(lambda : i) for i in range(10)]
c = [(lambda i=i: i) for i in range(10)]
a[2](), b[2](), c[2]()
Generating functions inside loop with lambda expression in python