from turtle import FRFRF it reset for in range it replace FLFRFLF prin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
from turtle import *
k = 'FRFRF'
'''k = 'F'''
it = 5
reset()
for i in range(it):
k = k.replace('F', 'FLFRFLF')
print(k)
up()
goto(-400, 150)
down()
for m in k:
if m == 'F':
forward(210//(3**(it-1)))
elif m == 'L':
left(60)
elif m == 'R':
right(120)
root.mainloop()