pygame draw line(displaysurfdarkgray( )(xwindowheight)for in range( windowheightcellsize)draw horizontal lines pygame draw line(displaysurfdarkgray( )(windowwidthy)just to make it easier to visualize the grid of cellswe call pygame draw line(to draw out each of the vertical and horizontal lines of the grid normallyto draw the vertical lines neededwe would need calls to pygame draw line(with the following coordinatespygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)skipped for brevity pygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)pygame draw line(displaysurfdarkgray( )( windowheight)instead of typing out all these lines of codewe can just have one line of code inside for loop notice that the pattern for the vertical lines is that the coordinate of the start and end point starts at and goes up to increasing by each time the coordinate is always for the start point and windowheight for the end point parameter that means the for loop should iterate over range( this is why the for loop on line iterates over range( windowwidthcellsizefor the horizontal linesthe coordinates would have to bepygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )skipped for brevity pygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )pygame draw line(displaysurfdarkgray( )(windowwidth )the coordinate ranges from to increasing by each time the coordinate is always for the start point and windowwidth for the end point parameter we can also use for loop here so we don' have to type out all those pygame draw line(calls email questions to the authoral@inventwithpython com