python画图程序飞机_Python海龟画图工具绘制叮当猫程序
t.fillcolor("blue")#填充顏色
t.begin_fill()#開始填充
t.circle(160)#畫圓
t.end_fill()#結束填充
t.up() #鼠標抬起
t.goto(-20,240)#重新調整畫筆的位置
t.down()#鼠標落下
#畫叮當貓。
import turtle;
t=turtle.Pen()
#畫頭
t.fillcolor("blue")
t.begin_fill()
t.circle(160)
t.end_fill()
#畫臉
t.fillcolor("white")
t.begin_fill()
t.circle(130)
t.end_fill()
#畫眼睛
t.up()
t.goto(-20,240)#第一只眼睛(左)
t.down()
t.fillcolor("#fff")
t.begin_fill()
t.circle(20)
t.up()
t.goto(20,240)#第二只眼睛
t.down()
t.circle(20)
t.end_fill()
#畫里面的眼珠黑色部分
t.fillcolor("black")
t.begin_fill()
t.circle(10)
t.up()
t.goto(-20,240)
t.down()
t.circle(10)
t.end_fill()
#畫鼻子
t.up()
t.goto(0,200)
t.down()
t.fillcolor("red")
t.begin_fill()
t.circle(20)
t.end_fill()
t.right(90)
t.forward(70)
#畫嘴巴
t.up()
t.goto(-50,100)
t.down()
t.circle(50,180)
#畫胡子
t.up()
t.goto(20,150)
t.down()
t.right(100)
t.forward(80)
t.up()
t.goto(20,180)
t.down()
t.left(30)
t.forward(80)
t.up()
t.goto(20,160)
t.down()
t.left(-10)
t.forward(80)
#畫左邊胡子
t.up()
t.goto(-20,160)
t.down()
t.right(180)
t.forward(80)
t.up()
t.goto(-20,180)
t.down()
t.right(20)
t.forward(80)
t.up()
t.goto(-20,150)
t.down()
t.right(-40)
t.forward(80)
t.up()
t.goto(0,-50)
t.write("Python青少年編程 .13684090437何老師 ", align="center",font=("微軟雅黑", 16, "bold"))
t.write("https://edu.51cto.com/course/17675.html ", align="center",font=("微軟雅黑", 16, "bold"))
turtle.done()
原文地址:https://blog.51cto.com/1388969/2421974
總結
以上是生活随笔為你收集整理的python画图程序飞机_Python海龟画图工具绘制叮当猫程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求一个好听的网名qq名。
- 下一篇: python异常值删除_python删除