python programming class pendowncommanddef __init__(self)pass def draw(self,turtle)turtle pendown( the accumulator pattern to use the different command classes that we have just definedour program will read the variable length records from the file as it did before using the loop and half pattern that we have already seen patterns of programmingsometimes called idiomsare important in computer science once we have learned an idiom we can apply it over and over in our programs this is useful to us because as we solve problems its nice to say"ohyesi can solve this problem using that idiomhaving idioms at our fingertips frees our minds to deal with the tougher problems we encounter while programming one important pattern in programming is the accumulator pattern this pattern is used in nearly every program we write when using this pattern you initialize an accumulator before loop and then inside the loop you add to the accumulator for instancethe code in sect uses the accumulator pattern to construct the list of squares from to list of squares initialize the accumulatorin this case list accumulator [ write some kind of for loop or while loop for in range( , )add to the accumulatorin this case add to the list accumulator accumulator [ * to complete our graphics programwe'll use the loop and half pattern to read the records from file and the accumulator pattern to add command object to our pylist container for each record we find in the file the code is given in sect graphics program import turtle command classes would be inserted here but are left out because they were defined earlier in the this copy belongs to 'acha