todocreate the quiz and answer key files todowrite out the header for the quiz todoshuffle the order of the states todoloop through all statesmaking question for each since this program will be randomly ordering the questions and answersyou'll need to import the random module to make use of its functions the capitals variable contains dictionary with us states as keys and their capitals as values and since you want to create quizzesthe code that actually generates the quiz and answer key files (marked with todo comments for nowwill go inside for loop that loops times (this number can be changed to generate any number of quiz files step create the quiz file and shuffle the question order now it' time to start filling in those todos the code in the loop will be repeated times--once for each quiz-so you have to worry about only one quiz at time within the loop first you'll create the actual quiz file it needs to have unique filename and should also have some kind of standard header in itwith places for the student to fill in namedateand class period then you'll need to get list of states in randomized orderwhich can be used later to create the questions and answers for the quiz add the following lines of code to randomquizgenerator py#python randomquizgenerator py creates quizzes with questions and answers in random orderalong with the answer key --snip-generate quiz files for quiznum in range( )create the quiz and answer key files quizfile open( 'capitalsquiz{quiznum txt'' 'answerkeyfile open( 'capitalsquiz_answers{quiznum txt'' 'write out the header for the quiz quizfile write('name:\ \ndate:\ \nperiod:\ \ 'quizfile write(( 'state capitals quiz (form{quiznum })'quizfile write('\ \ 'shuffle the order of the states states list(capitals keys()random shuffle(statestodoloop through all statesmaking question for each reading and writing files