RosettaCodeData/Task/Sierpinski-triangle-Graphical/Python/sierpinski-triangle-graphical-1.py

10 lines
199 B
Python
Raw Permalink Normal View History

2018-06-22 20:57:24 +00:00
# likely the simplest possible version?
import turtle as t
def sier(n,length):
if (n==0):
return
for i in range(3):
sier(n-1, length/2)
t.fd(length)
t.rt(120)