while truemain game loop for event in pygame event get()line is for loop that will iterate over the list of event objects that was returned by pygame event get(on each iteration through the for loopa variable named event will be assigned the value of the next event object in this list the list of event objects returned from pygame event get(will be in the order that the events happened if the user clicked the mouse and then pressed keyboard keythe event object for the mouse click would be the first item in the list and the event object for the keyboard press would be second if no events have happenedthen pygame event get(will return blank list the quit event and pygame quit(function if event type =quitpygame quit(sys exit(event objects have member variable (also called attributes or propertiesnamed type which tells us what kind of event the object represents pygame has constant variable for each of possible types in the pygame locals modules line checks if the event object' type is equal to the constant quit remember that since we used the from pygame locals import form of the import statementwe only have to type quit instead of pygame locals quit if the event object is quit eventthen the pygame quit(and sys exit(functions are called the pygame quit(function is sort of the opposite of the pygame init(functionit runs code that deactivates the pygame library your programs should always call pygame quit(before they call sys exit(to terminate the program normally it doesn' really matter since python closes it when the program exits anyway but there is bug in idle that causes idle to hang if pygame program terminates before pygame quit(is called since we have no if statements that run code for other types of event objectthere is no eventhandling code for when the user clicks the mousepresses keyboard keysor causes any other type of event objects to be created the user can do things to create these event objects but it doesn' change anything in the program because the program does not have any event-handling code for these types of event objects after the for loop on line is done handling all the event objects that have been returned by pygame event get()the program execution continues to line pygame display update(email questions to the authoral@inventwithpython com