import turtle turtle shape turtle turtle penup turtle goto -200 turtle

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import turtle
turtle.shape('turtle')
turtle.penup()
turtle.goto(-200, 0)
turtle.pendown()
turtle.speed(1)
def Koch_Line (l ,n):
if n == 0:
turtle.forward(10)
return
l //= 3
Koch_Line(l, n-1)
turtle.left(60)
Koch_Line(l, n-1)
turtle.right(120)
Koch_Line(l, n-1)
turtle.left(60)
Koch_Line(l, n-1)
Koch_Line(400, 4)