from math import from tkinter import root Tk root title saikin canvas

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from math import *
from tkinter import *
root =Tk()
root.title('saikin')
canvas = Canvas(root, width = 1000 , height = 1000, bg = "lightblue")
x1 = 200
y1 = 200
x2 = 400
y2 = 200
x3 = 400
y3 = 400
x4 = 200
y4 = 400
n = int(input())
i = 0
while( i < n):
canvas.create_line(x1, y1, x2, y2 , x3 , y3 , x4 , y4 , x1 , y1)
x1 += 0,8*(x2-x1)
y2 += 0,8*(y3-y2)
X3 += 0,8*(x4-x3)
y4 += 0,8*(y4-y3)
i+=1
canvas.pack()
root.mainloop()