Štvorce stredovo symetrické

import tkinter

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

canvas.pack()
x0 = 100
y0 = 100
sirka0 = 140
farba1, farba2, farba3  = 'blue', 'green', 'black'
for i in range(8):
    x= x0 +250 
    y= y0 + 200 
    canvas.create_rectangle(x + i * sirka0/14 , y + i * sirka0/14, x + 140 - i * sirka0/14, y + 140 - i * sirka0/14, fill = farba1)
    farba1, farba2, farba3 = farba3, farba1, farba2


tkinter.mainloop()
naspäť