def main()win graphwin('back and forth' win yup(make right side up coordinatesrect rectangle(point( )point( )rect setfill("blue"rect draw(wincir circle(point( , ) cir setfill("yellow"cir draw(wincir circle(point( , ) cir setfill("red"cir draw(winfor in range( )cir move( time sleep for in range( )cir move(- time sleep win promptclose(win getwidth()/ main(read the discussion below of pieces of the code from the program above do not try to execute fragments alone there are both an old and new form of import statementfrom graphics import import time the program uses function from the time module the syntax used for the time module is actually the safer and more typical way to import module as you will see later in the programthe sleep function used from the time module will be referenced as time sleep(this tells the python interpreter to look in the time module for the sleep function if we had used the import statement from time import then the sleep function could just be referenced with sleep(this is obviously easierbut it obscures the fact that the sleep function is not part of the current module also several modules that program imports might have functions with the same name with the individual module name prefixthere is no ambiguity hence the form import modulename is actually safer than from modulename import you might think that all modules could avoid using any of the same function names with bit of planning to get an idea of the magnitude of the issuehave look at the number of modules available to python try the following in the in the shell (and likely wait number of seconds)help('modules'without module names to separate things outit would be very hard to totally avoid name collisions with the enormous number of modules you see displayedthat are all available to pythonback to the current example programthe main program starts with standard window creationand then makes three objects graphics