arkadiy3
Import turtle, math trt = turtle.Turtle() lst = [-1,0,1] step = 20 for i in range(3): trt.penup() trt.goto(step*lst[i]*4,0) trt.setheading(0) trt.forward(step*3) trt.setheading(0) trt.backward(step*1) for k in range(4): trt.pendown() trt.forward(step*2) trt.left(45) trt.forward(step*math.sqrt(8)) trt.left(45) turtle.mainloop()
Answers & Comments
trt = turtle.Turtle()
lst = [-1,0,1]
step = 20
for i in range(3):
trt.penup()
trt.goto(step*lst[i]*4,0)
trt.setheading(0)
trt.forward(step*3)
trt.setheading(0)
trt.backward(step*1)
for k in range(4):
trt.pendown()
trt.forward(step*2)
trt.left(45)
trt.forward(step*math.sqrt(8))
trt.left(45)
turtle.mainloop()