Zmenšujúce sa kruhy

import tkinter

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

canvas.pack()
x0 = 100
y0 = 100
r0 = 100
r = r0
posun = 0
farba1, farba2, farba3, farba4 = 'blue', 'black','red', 'green'
for i in range(10):
    x= x0 +250 
    y= y0 + 200 
    canvas.create_oval(x - r0 + posun, y + 100 -r0 + posun, x + r0 - posun, y + 100 + r0 - posun, fill=farba1)
    canvas.create_text(x, y+100, text='+')
    farba1, farba2, farba3, farba4= farba4, farba1, farba2, farba3
    posun = posun + (1/9) * r
    r = (8/9) * r

tkinter.mainloop()

naspäť