Jan-22-2021, 12:08 AM
You only need to shuffle the references to the questions and answers not the questions them selves. Observe :
from random import randint questions = ['What is 2 plus 2?', 'Why is there air?', 'Who wrote the book of love?'] answers = ['a) 1\nb) 2\nc) 3\nd) 4', 'a) To Breath\nb) To fly kits\nc) To fill volley balls\nd) All of the above', 'a) Donald Trump\nb) BashBedlam\nc) The Monotones\nd) God'] correct_answers = ['d', 'd', 'c'] question_number = randint (0, 2) print (questions [question_number]) print (answers [question_number]) print (f'The answer is {correct_answers [question_number]}.')