2022-11-13 10:39:28 -08:00

9 lines
198 B
Python

>>> def squares_list(n):
... squares = []
... for i in range(n+1):
... squares.append(i**2)
... return squares
...
>>> squares_list(11)
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100]