Exerpad
🔥 0
0 XP
Exercise 3 · Chapter: Your First FrameRequired+50 XP

A Line Across

Painting forty squares one line at a time would be forty lines of code. This is exactly what loops are for.

Draw a white line all the way across row 6, from the left edge to the right.

Use range(WIDTH) rather than range(40). Same answer today, but it says what you mean.

Expected output
........................................
........................................
........................................
........................................
........................................
........................................
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
........................................
........................................
........................................
........................................
........................................
........................................
########################################
Need a hint?
3 available · costs 5 XP each
python
def draw(state):
grid = blank_grid()
# Loop over every column and paint row 6 white.
return grid