Python选修课第一届Turtle绘图大赛田康林赵冰珂组
Posted sninius
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python选修课第一届Turtle绘图大赛田康林赵冰珂组相关的知识,希望对你有一定的参考价值。
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绘图大赛田康林赵冰珂组的主要内容,如果未能解决你的问题,请参考以下文章
Python笔记_第一篇_童子功_8.画图工具(小海龟turtle)