Im creating a game where i have roads that move down and when the y is 0, i add another image on top of it, i tried to detect whether the image if off of the screen and remove it from the list, just so the list doesnt contain a billion characters. My code:
for i in range(len(lanes_y)):
        #increases the y of every image
        lanes_y[i] += 1
        #if the y is 0 we add a new image on top of the image
        if lanes_y[i] == 0:
            lanes_y.append(lanes_y[i] - 500)
        #if one of the images is less then 500 i remove it from the list to reduce lag
        if lanes_y[i] >= 500:
            lanes_y.pop(i)
 
     
     
    