lists the code worksbut it is very tedious if we want to add more questionswe have to copy and paste one of these blocks of code and then change bunch of things if we decide to change one of the questions or the order of the questionsthen there is fair amount of rewriting involved if we decide to change the design of the gamelike not telling the user the correct answerthen every single block of code has to be rewritten tedious code like this can often be greatly simplified with lists and loopsquestions 'what is the capital of france''which state has only one neighbor'answers 'paris ''maine 'num_right for in range(len(questions))guess input(questions[ ]if guess lower()==answers[ilower()print'correct 'num_right=num_right+ elseprint'wrong the answer is 'answers[ ]print'you have 'num_right'out of ' + 'right 'if you look carefully at this codeyou will see that the code in the loop is the nearly the same as the code of one of the blocks in the previous programexcept that in the statements where we print the questions and answerswe use questions[iand answers[iin place of the actual text of the questions themselves this illustrates the general techniqueif you find yourself repeating the same code over and overtry lists and for loop the few parts of your repetitious code that are varying are where the list code will go the benefits of this are that to change questionadd questionor change the orderonly the questions and answers lists need to be changed alsoif you want to make change to the programlike not telling the user the correct answerthen all you have to do is modify single lineinstead of twenty copies of that line spread throughout the program exercises write program that asks the user to enter list of integers do the following(aprint the total number of items in the list (bprint the last item in the list (cprint the list in reverse order (dprint yes if the list contains and no otherwise (eprint the number of fives in the list (fremove the first and last items from the listsort the remaining itemsand print the result