noticing regular patterns needed by the calls and using loops is clever programmer trick to save us from lot of typing we could have typed out all pygame draw line(calls and the program would have worked the exact same but by being little bit cleverwe can save ourselves lot of work if __name__ ='__main__' main(after all the functions and constants and global variables have been defined and createdthe main(function is called to start the game don' reuse variable names take look at few lines of code from the drawworm(function again wormsegmentrect pygame rect(xycellsizecellsize pygame draw rect(displaysurfdarkgreenwormsegmentrect worminnersegmentrect pygame rect( cellsize cellsize pygame draw rect(displaysurfgreenworminnersegmentrectnotice that two different rect objects are created on lines and the rect object created on line is stored in the wormsegmentrect local variable and is passed to the pygame draw rect(function on line the rect object created on line is stored in the worminnersegmentrect local variable and is passed to the pygame draw rect(function on line every time you create variableit takes up small amount of the computer' memory you might think it would be clever to reuse the wormsegmentrect variable for both rect objectslike this wormsegmentrect pygame rect(xycellsizecellsizepygame draw rect(displaysurfdarkgreenwormsegmentrectwormsegmentrect pygame rect( cellsize cellsize pygame draw rect(displaysurfgreenworminnersegmentrectbecause the rect object returned by pygame rect(on line won' be needed after we can overwrite this value and reuse the variable to store the rect object returned by pygame rect(on line since we are now using fewer variables we are saving memoryright