1. 程式人生 > >Python選修課第一屆Turtle繪圖大賽田康林趙冰珂組

Python選修課第一屆Turtle繪圖大賽田康林趙冰珂組

baidu bsp pen color tps nco left python lan

點擊此處查看視頻

from turtle import*
setup(600,600,200,200)
#
penup()
goto(-190,0)
seth(-90)
pendown()
pencolor(goldenrod3)
pensize(5)
begin_fill()
circle(190,360)
fillcolor(lightgoldenrod1)
end_fill()
#畫眉毛
penup()
goto(-135,155)
seth(30)
pendown()
pencolor(black)
pensize(8)
circle(-30,120)
penup()
goto(125,160)
seth(
150) pendown() pencolor(black) pensize(8) circle(30,120) hideturtle() #畫嘴巴 pensize(7) penup() goto(-138,-42) pencolor(goldenrod3) pendown() seth(-75) circle(138,150) #左眼眶 penup() pensize(4) pencolor(goldenrod3) goto(-180,90) pendown() seth(40) begin_fill() circle(-112,80) penup() goto(-180,90) seth(-130) pendown() circle(
20,120) seth(40) circle(-97,73) seth(10) circle(18,110) fillcolor(white) end_fill() #右眼眶 penup() goto(40,90) pendown() seth(40) begin_fill() circle(-112,80) penup() goto(40,90) pendown() seth(-130) circle(20,120) seth(40) circle(-97,73) seth(10) circle(18,110) fillcolor(white) end_fill() #畫眼珠 pensize(2) pencolor(
black) penup() goto(77,92) pendown() begin_fill() circle(15,360) fillcolor(black) end_fill() penup() goto(-145,91) pendown() begin_fill() circle(15,360) fillcolor(black) end_fill() #畫腮紅 pensize(1) pencolor(lightsalmon1) begin_fill() penup() goto(-180,25) pendown() seth(-90) for i in range(2): for j in range(10): forward(j) left(9) for j in range(10,0,-1): forward(j) left(9) fillcolor(lightsalmon1) end_fill() pensize(1) pencolor(lightsalmon1) begin_fill() penup() goto(100,25) pendown() seth(-90) for i in range(2): for j in range(10): forward(j) left(9) for j in range(10,0,-1): forward(j) left(9) fillcolor(lightsalmon1) end_fill() #畫嘴巴 pensize(7) penup() goto(-138,-42) pencolor(goldenrod3) pendown() seth(-75) circle(138,150) hideturtle()

Python選修課第一屆Turtle繪圖大賽田康林趙冰珂組