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)
Run This Example!
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

PyTamaro logo

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

Privacy Policy • Platform Version 3caedaf3 (October 8, 2026 at 2:03:15 PM UTC)