# -*- coding: utf-8 -*- import turtle win = turtle.Screen() win.setup(0.9,0.9) ###### def drawTree(n, ang, t): """Draw a Tree""" if n < 5: t.pencolor('green') else: t.pencolor('black') t.fd(n*15) if n == 0: pass else: t.left(ang) drawTree(n-1, ang, t) t.right(2*ang) drawTree(n-1, ang, t) t.left(ang) t.up() t.back(n*15) t.down() tt = turtle.Turtle() tt.up() tt.sety(-350) tt.left(90) tt.pd() drawTree(7, 20, tt) ###### win.exitonclick()