array-based sequences class scoreboard """fixed-length sequence of high scores in nondecreasing order "" def init (selfcapacity= ) """initialize scoreboard with given maximum capacity all entries are initially none ""reserve space for future scores self board [nonecapacity number of actual entries self def getitem (selfk) """return entry at index "" return self board[ def str (self) """return string representation of the high score list "" return \ join(str(self board[ ]for in range(self ) def add(selfentry) """consider adding entry to high scores "" score entry get score does new entry qualify as high score answer is yes if board not full or score is higher than last entry good self self board[- get score if goodno score drops from list if self len(self board)so overall number increases self + shift lower scores rightward to make room for new entry self while and self board[ - get scorescoreshift entry from - to self board[jself board[ - - and decrement when doneadd new entry self board[jentry code fragment python code for scoreboard class that maintains an ordered series of scores as gameentry objects