pygame init( set up the window displaysurf pygame display set_mode(( ) pygame display set_caption('drawing' set up the colors black white ( red ( green blue draw on the surface object displaysurf fill(white pygame draw polygon(displaysurfgreen(( )( )( )( )( )) pygame draw line(displaysurfblue( )( ) pygame draw line(displaysurfblue( )( ) pygame draw line(displaysurfblue( )( ) pygame draw circle(displaysurfblue( ) pygame draw ellipse(displaysurfred( ) pygame draw rect(displaysurfred( ) pixobj pygame pixelarray(displaysurf pixobj[ ][ black pixobj[ ][ black pixobj[ ][ black pixobj[ ][ black pixobj[ ][ black del pixobj run the game loop while true for event in pygame event get() if event type =quit pygame quit( sys exit( pygame display update(when this program is runthe following window is displayed until the user closes the window