data collections for pip in self pipspip setfill(self backgroundsee how these two lines of code loop through the entire collection of pips to change their colorthis required seven lines of code in the previous version using separate instance variables similarlywe can turn set of pips back on by indexing the appropriate spot in the pips list in the original programpips and were turned on for the value self pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundin the new versionthis corresponds to pips in positions and since the pips list is indexed starting at parallel approach could accomplish this task with these three lines of codeself pips[ setfill(self foregroundself pips[ setfill(self foregroundself pips[ setfill(self foregrounddoing it this way makes explicit the correspondence between the individual instance variables used in the first version and the list elements used in the second version by subscripting the listwe can get at the individual pip objectsjust as if they were separate variables howeverthis code does not really take advantage of the new representation here is an easier way to turn on the same three pipsfor in [ , , ]self pips[isetfill(self foregroundusing an index variable in loopwe can turn all three pips on using the same line of code the second approach considerably shortens the code needed in the setvalue method of the dieview class here is the updated algorithmloop through pips and turn all off determine the list of pip indexes to turn on loop through the list of indexes and turn on those pips we could implement this algorithm using multi-way selection followed by loop for pip in self pipsself pip setfill(self backgroundif value = on [ elif value = on [ , elif value = on [ , ,