#darneveshtane in tabe az raveshe bazgashti estefade shode yani heine ejraie satr ha
#dobare tabe run mishe
import turtle


def tree(l, pn):                  #khodeman ye teba ba greftan 2 data tarif mikonim
    turtle.pensize(pn)            #size khot ra tain mikonim
    if l < 10:                    #baes mishavad ta vaqti k l<10 shavad kar edame yabad
        turtle.forward(l)         #neshangare turtle 1 vahed be jolo mire
        turtle.backward(l)        #1 vahed be aqab barmigardad
        return
    turtle.forward(l)
    turtle.left(40)               #40 daraje padsaatgard micharkhe
    tree(l * 3 / 4.0, pn - 1)     #dobare tabeie tree ro ejra mikone vali l kochiktar mishavad
    turtle.right(100)             #100 daraje saatgard micharkhe
    tree(l * 2 / 3.0, pn - 1)     #dobare tabeie tree ra ejra mikone
    turtle.left(60)               #60 daraje pad saat gardmicharkhe ta be jaie avalesh berese
    turtle.backward(l)



turtle.speed(200)                 #sorate rasm ra moshakhas mikone
turtle.left(90)
tree(100, 10)                      #ejraie tabe ba in 2 meqdar
turtle.done()