Obdĺžniky stredovo symetrické

import tkinter

canvas = tkinter.Canvas(bg='white', width=1000, height=2000)

canvas.pack()
x = 100
y = 100
sirka1 = 240
sirka2 = 130
farba1, farba2, farba3  = 'blue', 'green', 'black'
for i in range(8):
    canvas.create_rectangle(x + i * 10 , y + i * 5, x + sirka1 - i * 10, y + sirka2 - i * 5, fill = farba1)
    farba1, farba2, farba3 = farba3, farba1, farba2

tkinter.mainloop()
naspäť