資源簡介
用oython畫標準籃球場,標注有尺寸。供中小學生及python愛好者參考,本代碼在python 3.7.4以上通過。
代碼片段和文件信息
#畫大邊框
import?turtle?as?t
t.pensize(2)
t.up()
t.goto(320190)
t.down()
t.fillcolor(“red“)
t.begin_fill()
t.left(180)
for?i?in?range(13):
????t.fd(640)
????t.left(90)
????t.fd(380)
????t.left(90)
t.end_fill()
#畫操場框
t.up()
t.goto(280150)
t.down()
t.pencolor(“white“)
t.fillcolor(“blue“)
t.begin_fill()
t.left(0)
for?i?in?range(13):
????t.fd(560)
????t.left(90)
????t.fd(300)
????t.left(90)
t.end_fill()
#畫中心圓
t.up()
t.goto(036)
t.down()
t.fillcolor(“red“)
t.begin_fill()
t.circle(36)
t.end_fill()
#畫右操場框
t.up()
t.goto(28049)
t.down()
t.fillcolor(“red“)
t.begin_fill()
t.left(0)
for?i?in?range(13):
????t.fd(116)
????t.left(90)
????t.fd(98)
????t.left(90)
t.end_fill()
#畫左操場框
t.up()
t.goto(-28049)
t.down()
t.fillcolor(“red“)
t.begin_fill
- 上一篇:python3安卓QQ5.8協議
- 下一篇:Teamviewer修改ID的腳本
評論
共有 條評論