Version récursive du script de : https://my.numworks.com/python/eloidrai1/sierpinski
Mⷨᴀͣ ᴄͨʜͪᴀͣɪͥɴᴇͤ ʸᵒᵘᵗᵘᵇᵉ‧ᶜᵒᵐ/ˢᶜʰʳᵃᶠ
from kandinsky import fill_rect from time import sleep def tapis(x,y,l,n): c = max(1, l // 3) if n == 0: fill_rect(x, y, l, l, (255,255,255)) else: for k in range(9): if k != 4: tapis(x + (k % 3) * c, y + (k // 3) * c, c, n - 1) while True: for r in range(1,6): fill_rect(0,0,320,222,(0,0,0)) tapis(55,5,210,r) sleep(1)