This is the list
places = ["London", "India", "America", "Australia", "Cambodia", "China",
"Dubai", "Egypt", "France", "Germany", "Japan", "Jordan",
"Korea", "Myanmar", "Peru", "Russia", "Singapore", "Spain"]
I randomised the list:
random_place = random.choice(places)
Here I have tried to display random items from the list. I have tried using for
loop and time.sleep
function but it didn't work.
def text():
game_font = pygame.freetype.SysFont("monospace", 35)
text_surface, rect = game_font.render(random_place, (0, 0, 0))
screen.blit(text_surface, (680, 420))
# Game loop
running = True
while running:
screen.fill((255, 194, 102)) # RGB
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
card()
text()
pygame.display.update()
It would be great if anyone could solve this issue.