I want to generate a list in python as follows -
[1, 1, 2, 4, 3, 9, 4, 16, 5, 25 .....]
You would have figured out, it is nothing but n,
n,
Another option:
reduce(lambda x,y: x + [y, y*y], range(1,10), [])