```
import turtle
def tree(n,l):
turtle.pen(fillcolor="black", pencolor="red", pensize=10)
turtle.forward(225)
print(sorted(turtle.pen().items()))
print('------------')
print(turtle.pen().items())
tree(12,100)
tree(5,'5')
```
```
from turtle import *
from random import *
from math import *
def tree(n,l):
pd()#下筆
#陰影效果
t = cos(radians(heading()+45))/8+0.25
pencolor(t,t,t)
pensize(n/3)
forward(l)#畫樹枝
if n>0:
b = random()*15+10 #右分支偏轉角度
c = random()*15+10 #左分支偏轉角度
d = l*(random()*0.25+0.7) #下一個分支的長度
#右轉一定角度,畫右分支
right(b)
tree(n-1,d)
#左轉一定角度,畫左分支
left(b+c)
tree(n-1,d)
#轉回來
right(c)
tree(5,50)
```
- py轉exe
- py服務器
- py登錄
- py查詢
- 爬TB熱賣1017
- 爬TB分類1015
- 爬BD文庫1010
- 爬文庫924
- json917
- decode912
- 轉碼910
- radians829
- turtle827
- 畫葉子820
- 樹干815
- Turtle, mainloop718
- sorted716
- random711
- turtle.colormode709
- abs704
- begin_fill702
- randint,random627
- isalpha625
- keyword620
- compile618
- judge613
- list1.copy611
- random.choice606
- format_randint604
- save_csv528
- jieba523
- wordcloud521
- wordcloud516
- jieba.lcut514
- counts503
- format423
- 花瓣418
- strftime416
- turtle.fillcolor411
- random.random409
- pensize404
- 花蕊328
- input327
- eval_float320
- open319
- while314
- JCR影響因子313
- _to_chinese4_312
- encoding306
- read305
- flask1029