list_a = [2, 4, 3, 6, 3, 8, 5]
list comprehension is very useful.
list_b = [a**2 for a in list_a]
I want to know how to write a self-reference in the list comprehension.
For example:
list_c = [a**2 if i == 0 else a*2 + (itself[i-1]) for i, a in enumurate(list_a)]
how to write the part of itself[i-1]
?