win promptclose(win getwidth()/ main(read the following discussion of program parts moving single elementary shape is rather limiting it is much more interesting to compose more complicated combinationlike the face from the earlier example face py to animate such combinationyou cannot use the old moveonline functionbecause we want all the parts to move togethernot one eye all the way across the screen and then have the other eye catch upa variation on moveonline is needed where all the parts move together we need all the parts of the face to move one stepthen sleep onceand all move againsleep oncethis could all be coded in single methodbut there are really two ideas here moving group of objects one step animating number of moves for the group this suggests two functions another issue is how to handle group of elementary graphics objects the most basic combination of objects in python is listso we assume parameter shapelistwhich is list of elementary graphics objects for the first functionmovealljust move all the objects in the list one step since we assume list of objects and we want to move eachthis suggests for-each loopdef moveall(shapelistdxdy)''move all shapes in shapelist by (dxdy''for shape in shapelistshape move(dxdyhaving this functionwe can easily write the second function moveallonlinewith simple change from the moveonline functionsubstituting the moveall function for the line with the move methoddef moveallonline(shapelistdxdyrepetitionsdelay)'''animate the shapes in shapelist along line move by (dxdyeach time repeat the specified number of repetitions have the specified delay (in secondsafter each repeat ''for in range(repetitions)moveall(shapelistdxdytime sleep(delaythe code in main to construct the face is the same as in the earlier example face py once all the pieces are constructed and coloredthey must be placed in listfor use in moveallonlinefacelist [headeye eye mouththenlaterthe animation uses the facelist to make the face go back and forthmoveallonline(facelist moveallonline(facelist- this version of the program has encapsulated and generalized the moving and animating by creating functions and adding parameters that can be substituted againmake sure you see how the functions communicate to make the whole program work this is an important and non-trivial use of functions in fact all parts of the face do not actually move at oncethe moveall loop code moves each part of the face separatelyin sequence depending on your computer setupall the parts of the face may appear to move together againthe computer is much faster than our eyes on computer that repaints the screen fast enoughthe only images we notice are the ones on the screen when the animation is sleeping objects and methods