Every Pygame program follows the same shape: initialize Pygame, create a display Surface, run a loop that handles events/updates/draws every frame, then quit cleanly when the window closes.
1-B 2-B 3-B 4-B | 5 pygame.event.get() 6 pygame.display.flip() (or .update()) 7 = it clears the previous frame so old drawings don't smear across the screen 8 = handle events, update game state, draw/render the frame 9 = calling it mid-loop would shut down Pygame while the loop is still trying to use it, causing errors | 10 = without clock.tick() the loop runs as fast as the CPU allows — frame rate becomes wildly inconsistent across machines and CPU usage spikes to 100%, since nothing paces the loop