python simple tree code example

Example: how to make a tree by python

import turtle
arrow=turtle.Turtle()
arrow.color ("green")
window=turtle.Screen()
window.bgcolor("cyan")
arrow.begin_fill()
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.forward(60)
arrow.pendown()
arrow.begin_fill()
arrow.setheading(0)
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.setheading(0)
arrow.forward(40)
arrow.pendown()
arrow.begin_fill()
arrow.color("brown")
arrow.setheading(270)
arrow.forward(50)
arrow.setheading(0)
arrow.forward(20)
arrow.setheading(90)
arrow.forward(50)
arrow.end_fill()
arrow.penup()
arrow.forward(150)
arrow.setheading(180)
arrow.forward (125)
arrow.pendown()
arrow.color ("green")
arrow.begin_fill()
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.forward(60)
arrow.pendown()
arrow.begin_fill()
arrow.setheading(0)
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.setheading(0)
arrow.forward(40)
arrow.pendown()
arrow.begin_fill()
arrow.color("brown")
arrow.setheading(270)
arrow.forward(50)
arrow.setheading(0)
arrow.forward(20)
arrow.setheading(90)
arrow.forward(50)
arrow.end_fill()
arrow.penup()
arrow.forward(30)
arrow.color("green")
turtle.done