Counter list in Python
<p>I've written a program that pulls a random coordinate/color set from a list and draws a circle in a graphics window. I want it to <em>stop</em> drawing circles as soon as every coordinate/color set has been drawn at least once. I also want to document how many times each of the 9 possible coordinate/color sets were used. I've initialized a counter, <code>count = [0, 0, 0, 0, 0, 0, 0, 0, 0]</code> that I want to print each time a new circle is drawn, appended with the number of times each state has been used. Tips on how to do this? </p>

<p>Example output in shell:</p>

<pre><code>count = [1, 0, 0, 0, 0, 0, 0, 0, 0]
count = [2, 0, 0, 0, 0, 0, 0, 0, 0]
count = [2, 1, 0, 0, 0, 0, 0, 0, 0]
count = [2, 1, 0, 0, 1, 0, 0, 0, 0]
count = [2, 1, 1, 0, 1, 0, 0, 0, 0]
count = [2, 1, 1, 0, 1, 0, 0, 0, 1]
count = [2, 1, 1, 0, 1, 0, 1, 0, 1]
count = [2, 1, 1, 0, 1, 0, 1, 1, 1]
count = [2, 1, 1, 1, 1, 0, 1, 1, 1]
count = [2, 1, 1, 1, 1, 1, 1, 1, 1]
</code></pre>

<p>Please and thank you in advance!</p>

<pre><code>import random, turtle

wn = turtle.Screen()

alex = turtle.Turtle()
alex.pensize(3)
alex.color("black")


def turtle_draw():
    '''draws a circle with given coordinates and in a
given color, prints a counter.'''

    color, place = random_state_finder()
    alex.pu()
    alex.goto(place)
    alex.shape("circle")
    alex.shapesize(3)
    alex.fillcolor(color)

    count = [0, 0, 0, 0, 0, 0, 0, 0, 0]
    wn.ontimer(turtle_draw, 250)

def random_state_finder():
    '''randomly generates a state number from 0 to 8
and assigns the state's data to color and place.'''

    rng = random.Random()
    state_num = rng.randrange(0, 8)

    L = [((-150, 150), "red"), ((0, 150), "orange"),
              ((150, 150), "yellow"), ((-150, 0), "green"),
              ((0, 0), "blue"), ((150, 0), "violet"),
              ((-150, -150), "cyan"), ((0, -150), "magenta"),
              ((-150, -150), "purple")]

    random_state = L[state_num]

    color = random_state[1]
    place = random_state[0]

    return color, place

turtle_draw()
</code></pre>