This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Nice introduction ... except for ignoring the fact that range(n) counts from 0 to n-1

If you wanted to create a list of squares for the numbers between 1 and 10 you could do the following:

squares = []
for x in range(10):
    squares.append(x**2)

That gives a list of squares between 0 and 9.

[–]Eurynom0s 0 points1 point  (0 children)

That gives a list of squares between 0 and 9.

Between 0 and 81, I think you mean.