Hello, I'm currently learning python. I've been using it for around three days or so now, going at it slow. I'm currently attempting to make a simple slot machine game.

I'm using pygame to do all the drawing etc, but I've stumbled across a problem. I'm using a random number which then assigns a different colour to the Icon which gets spins. In other words, I draw 9 circles always in the same place, but then the colour changes depending on the random number.

I've done a little bit of testing, but the colours constantly change, and I don't know how to keep them the same, until the person presses spin again.

Note, my program is very bare as I was going to get it all drawn out then implement the game logic.

I'm not even up to that bit yet. My problem is that, because the random.randrange is within the game-loop every frame, it draws a different colour, however I need at least 9 random numbers that change one for every icon.

I'm not too good at explaining things, so if you want to the rest of my code, just ask

This may help. Since I've only been going a few days I haven't came across functions yet. But I'll skip to that part so I know what I'm doing with this code. I'll give it a try next time I have some free time and let you know if it works or not.