del mylist[ mylist ['dog''mouse''lizard'del mylist[ mylist ['mouse''lizard'del mylist[ mylist ['lizard'del mylist[ mylist [because we are deleting the item at the front of the listthe other items shift forward so that the next item in the list becomes the new --first|item this is the same way line works splitting list into list of lists def splitintogroupsof(groupsizethelist) splits list into list of listswhere the inner lists have at most groupsize number of items result [ for in range( len(thelist)groupsize) result append(thelist[ : groupsize] return result the splitintogroupsof(function (which will be called by the startgameanimation(functionsplits list into list of listswhere the inner lists have groupsize number of items in them (the last list could have less if there are less than groupsize items left over the call to range(on line uses the three-parameter form of range((if you are unfamiliar with this formtake look at length of the list is and the groupsize parameter is then range( len(thelist)groupsizeevaluates to range( this will give the variable the values and for the three iterations of the for loop the list slicing on line with thelist[ : groupsizecreates the lists that are added to the result list on each iteration where is and (and groupsize is )this list slicing expression would be thelist[ : ]then thelist[ : on the second iterationand then thelist[ : on the third iteration email questions to the authoral@inventwithpython com