def Nowich x1 y1 x2 y2 x3 y3 x4 y4 canvas create_line x1 y1 x2 y2 x3 y

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def Nowich( x1, y1, x2, y2 , x3 , y3 , x4 , y4 , n , k):
canvas.create_line(x1, y1, x2, y2 , x3 , y3 , x4 , y4 , x1 , y1)
x1 += (x2-x1)/8
y1 += (y2-y1)/8
x2 += (x3-x2)/8
y2 += (y3-y2)/8
x3 += (x4-x3)/8
y3 += (y4-y3)/8
x4 += (x1-x4)/8
y4 += (y1-y4)/8
n+=1
if (n<k):
Nowich(x1, y1, x2, y2 , x3 , y3 , x4 , y4 , n , k )
x1 = 400
y1 = 400
x2 = 800
y2 = 400
x3 = 800
y3 = 800
x4 = 400
y4 = 800
k = int(input())
n = 0
root =Tk()
root.title('saikin')
canvas = Canvas(root, width = 1000 , height = 1000, bg = "lightblue")
Nowich(x1, y1, x2, y2 , x3 , y3 , x4 , y4 , n , k)
canvas.pack()
root.mainloop()