-1

I am trying to make a riddle game in python but the problem is random function is repeating questions. I want that questions do not repeat can someone please help

1 Answers1

0

Place all the questions in the list and use this function

import random
random_indexes=random.sample(range(len(lst), no_of_questions))

Then iterate over the random_indexes and get the questions.

Maleehak
  • 671
  • 8
  • 17