unique number for the quiz that comes from quiznumthe for loop' counter the answer key for capitalsquiz txt will be stored in text file named capitalsquiz_answers txt each time through the loopthe {quiznum placeholder in 'capitalsquiz{quiznum txtand 'capitalsquiz_answers {quiznum txtwill be replaced by the unique numberso the first quiz and answer key created will be capitalsquiz txt and capitalsquiz_answers txt these files will be created with calls to the open(function at and with 'was the second argument to open them in write mode the write(statements at create quiz header for the student to fill out finallya randomized list of us states is created with the help of the random shuffle(function which randomly reorders the values in any list that is passed to it step create the answer options now you need to generate the answer options for each questionwhich will be multiple choice from to you'll need to create another for loop--this one to generate the content for each of the questions on the quiz then there will be third for loop nested inside to generate the multiple-choice options for each question make your code look like the following#python randomquizgenerator py creates quizzes with questions and answers in random orderalong with the answer key --snip-loop through all statesmaking question for each for questionnum in range( )get right and wrong answers correctanswer capitals[states[questionnum]wronganswers list(capitals values()del wronganswers[wronganswers index(correctanswer)wronganswers random sample(wronganswers answeroptions wronganswers [correctanswerrandom shuffle(answeroptionstodowrite the question and answer options to the quiz file todowrite the answer key to file the correct answer is easy to get--it' stored as value in the capitals dictionary this loop will loop through the states in the shuffled states listfrom states[ to states[ ]find each state in capitalsand store that state' corresponding capital in correctanswer the list of possible wrong answers is trickier you can get it by duplicating all the values in the capitals dictionary deleting the correct answer and selecting three random values from this list the random sample(function makes it easy to do this selection its first argument is the list you want