factory pattern screen obviouslywe want the screen to stay up little longerso let' just add sleep function to graphic_base py graphic_base py import pygame from time import sleep pygame init(screen pygame display set_mode(( )sleep( from the time package (part of the standard librarywe import the sleep functionwhich suspends execution for given number of seconds ten-second sleep was added to the end of the scriptwhich keeps the window open for ten seconds before the script completes execution and the window vanishes was very excited when created window on screen the first timebut when called my roommate over to show him my windowhe was completely underwhelmed suggest you add something to the window before showing off your new creation extend graphic_base py to add square to the window graphic_base py import pygame import time pygame init(screen pygame display set_mode(( , )pygame draw rect(screen( )pygame rect( )pygame display flip(time sleep( the pygame draw rect function draws rectangle to the screen variable that points to your window the second parameter is tuple containing the color used to fill the shapeandlastlythe pygame rectangle is passed in with the coordinates of the top left and bottom right corners the three values you see in the color tuple make up what is known as the rgb value (for red green blue)and each component is value out of which indicates the intensity of the component color in the final color mix