I wanted to choose an image from a list of other images at random and blit them. This is an example of what i have so far.
Q1 = pygame.image.load("Math/Q1.jpg").convert()
math_list.append(Q1)
Q2 = pygame.image.load("Math/Q2.jpg").convert()
math_list.append(Q2)
Q3 = pygame.image.load("Math/Q3.jpg").convert()
math_list.append(Q3)
Q4 = pygame.image.load("Math/Q4.jpg").convert()
math_list.append(Q4)
Q5 = pygame.image.load("Math/Q5.jpg").convert()
math_list.append(Q5)
These are the variables i have appended to the list math_list
. How would i now randomly choose one image, blit it at the coordinates (200, 0
) and then make sure i dont open that image up again.
This is not the same as any others because it does not focus on pictures exactly. And does not show how to remove after iterating over them
Any help is very much appreciated. Thanks :)