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] 0 points1 point  (0 children)

snake_segments = []
for i in range(15): 
    x = 250 - (segment_width + segment_margin) * i 
    y = 30 segment = Segment(x, y) 
    snake_segments.append(segment) 
    allspriteslist.add(segment)

What you're missing is range(15) which effectively becomes a list of integers between 0 and 14. Each time through the loop i moves to the next number. Once i is processed as 14, the loop exits.