Try This
import turtle import random def tree(trunkLength,t): if trunkLength < 5: return else: t.forward(trunkLength) tAmount = random.randint(10,30) t.right(tAmount) dsub = random.randint(5,15) tree(trunkLength-dsub,t) t.left(2*tAmount) tree(trunkLength-dsub,t) t.right(tAmount) t.backward(trunkLength) t = turtle.Turtle() t.speed(5) t.width(1) t.left(90) t.up() t.backward(300) t.down() t.color('brown') tree(85,t)
Run