self pip setfill(self backgroundself pip setfill(self backgroundself pip setfill(self backgroundself pip setfill(self backgroundself pip setfill(self backgroundself pip setfill(self backgroundturn correct pips on if value = self pip setfill(self foregroundelif value = self pip setfill(self foregroundself pip setfill(self foregroundelif value = self pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundelif value = self pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundelif value = self pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundelseself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundself pip setfill(self foregroundthere are couple of things worth noticing in this code firstin the constructori have defined set of values that determine various aspects of the die such as its color and the size of the pips calculating these values in the constructor and then using them in other places allows us to easily tweak the appearance of the die without having to search through the code to find all the places where those values are used actually figured out the specific calculations (such as the pip size being one-tenth of the die sizethrough process of trial and error another important thing to notice is that have added an extra method __makepip that was