Learn Programming in Python with Graphics

block_size = 25
num_blocks = 16
line = empty_graphic()
for col in range(num_blocks):
    if col % 2 == 0:
        color = black
    else:
        color = white
    block = rectangle(block_size, block_size, color)
    line = beside(line, block)
second_line = rotate(180, line)
finish_line = above(line, second_line)
show_graphic(finish_line)
Try it Now!
Directly in Your Browser
Graphical output from execution result

Learn with PyTamaro

Teach with PyTamaro

PyTamaro is a synergistic collaboration between university and school teachers
The library is an open-source project hosted on GitHub

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version a9143b0 (Sun, 14 Dec 2025 12:09:46 GMT)