代码拉取完成,页面将自动刷新
from turtle import*
def eyes(x,y):
goto(x,y)
color("black")
penup()
setheading(90)
forward(-10)
setheading(0)
pendown()
begin_fill()
circle(10)
end_fill()
color("white")
penup()
setheading(-180)
forward(5)
setheading(-270)
forward(8)
setheading(0)
pendown()
begin_fill()
circle(3)
end_fill()
penup()
def head(x,y):
goto(x,y)
pensize(2)
color("black")
setheading(0)
pendown()
forward(200)
setheading(90)
forward(-60)
setheading(180)
forward(160)
setheading(0)
circle(5,-90)
penup()
goto(200,-30)
pendown()
forward(20)
setheading(180)
forward(160)
setheading(0)
right(105)
forward(50)
setheading(180)
forward(120)
setheading(75)
forward(180)
setheading(0)
right(60)
forward(50)
setheading(0)
left(60)
forward(50)
setheading(0)
right(90)
forward(45)
penup()
def nose(x,y):
goto(x,y)
pensize(2)
setheading(0)
pendown()
begin_fill()
circle(15)
end_fill()
penup()
def main():
pensize(4)
colormode(255) #将其设置为1.0或255.随后 颜色三元组的r,g,b值必须在0 .. cmode范围内
#color((250,128,10),"orange")
#setup(840,500)
#screensize(500,500)
speed(5)
#眼睛
eyes(0,0)
#头
head(0,30)
#鼻子
nose(185,30)
hideturtle()
if __name__ == '__main__':
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。