i try to make a simple list f.e. x=n**2+1
code is
then it prints all...
any suggestions?
code is
1 2 3 4 5 |
x = [] for n in range ( 4 ): y = n * * 2 + 1 x.append(y) print (x) |
Output:[1]
[1, 2]
[1, 2, 5]
[1, 2, 5, 10]
i need only the last...any suggestions?