1. import turtle
    2. # coding:utf-8
    3. from turtle import*
    4. def nose(x,y):#鼻子
    5. pu()
    6. goto(x,y)
    7. pd()
    8. seth(-30)
    9. begin_fill()
    10. a=0.4
    11. for i in range(120):
    12. if 0<=i<30 or 60<=i<90:
    13. a=a+0.08
    14. lt(3) #向左转3度
    15. fd(a) #向前走a的步长
    16. else:
    17. a=a-0.08
    18. lt(3)
    19. fd(a)
    20. end_fill()
    21. pu()
    22. seth(90)
    23. fd(25)
    24. seth(0)
    25. fd(10)
    26. pd()
    27. pencolor(255,155,192)
    28. seth(10)
    29. begin_fill()
    30. circle(5)
    31. color(160,82,45)
    32. end_fill()
    33. pu()
    34. seth(0)
    35. fd(20)
    36. pd()
    37. pencolor(255,155,192)
    38. seth(10)
    39. begin_fill()
    40. circle(5)
    41. color(160,82,45)
    42. end_fill()
    43. def head(x,y):#头
    44. color((255,155,192),"pink")
    45. pu()
    46. goto(x,y)
    47. seth(0)
    48. pd()
    49. begin_fill()
    50. seth(180)
    51. circle(300,-30)
    52. circle(100,-60)
    53. circle(80,-100)
    54. circle(150,-20)
    55. circle(60,-95)
    56. seth(161)
    57. circle(-300,15)
    58. pu()
    59. goto(-100,100)
    60. pd()
    61. seth(-30)
    62. a=0.4
    63. for i in range(60):
    64. if 0<=i<30 or 60<=i<90:
    65. a=a+0.08
    66. lt(3) #向左转3度
    67. fd(a) #向前走a的步长
    68. else:
    69. a=a-0.08
    70. lt(3)
    71. fd(a)
    72. end_fill()
    73. def ears(x,y): #耳朵
    74. color((255,155,192),"pink")
    75. pu()
    76. goto(x,y)
    77. pd()
    78. begin_fill()
    79. seth(100)
    80. circle(-50,50)
    81. circle(-10,120)
    82. circle(-50,54)
    83. end_fill()
    84. pu()
    85. seth(90)
    86. fd(-12)
    87. seth(0)
    88. fd(30)
    89. pd()
    90. begin_fill()
    91. seth(100)
    92. circle(-50,50)
    93. circle(-10,120)
    94. circle(-50,56)
    95. end_fill()
    96. def eyes(x,y):#眼睛
    97. color((255,155,192),"white")
    98. pu()
    99. seth(90)
    100. fd(-20)
    101. seth(0)
    102. fd(-95)
    103. pd()
    104. begin_fill()
    105. circle(15)
    106. end_fill()
    107. color("black")
    108. pu()
    109. seth(90)
    110. fd(12)
    111. seth(0)
    112. fd(-3)
    113. pd()
    114. begin_fill()
    115. circle(3)
    116. end_fill()
    117. color((255,155,192),"white")
    118. pu()
    119. seth(90)
    120. fd(-25)
    121. seth(0)
    122. fd(40)
    123. pd()
    124. begin_fill()
    125. circle(15)
    126. end_fill()
    127. color("black")
    128. pu()
    129. seth(90)
    130. fd(12)
    131. seth(0)
    132. fd(-3)
    133. pd()
    134. begin_fill()
    135. circle(3)
    136. end_fill()
    137. def cheek(x,y):#腮
    138. color((255,155,192))
    139. pu()
    140. goto(x,y)
    141. pd()
    142. seth(0)
    143. begin_fill()
    144. circle(30)
    145. end_fill()
    146. def mouth(x,y): #嘴
    147. color(239,69,19)
    148. pu()
    149. goto(x,y)
    150. pd()
    151. seth(-80)
    152. circle(30,40)
    153. circle(40,80)
    154. def body(x,y):#身体
    155. color("red",(255,99,71))
    156. pu()
    157. goto(x,y)
    158. pd()
    159. begin_fill()
    160. seth(-130)
    161. circle(100,10)
    162. circle(300,30)
    163. seth(0)
    164. fd(230)
    165. seth(90)
    166. circle(300,30)
    167. circle(100,3)
    168. color((255,155,192),(255,100,100))
    169. seth(-135)
    170. circle(-80,63)
    171. circle(-150,24)
    172. end_fill()
    173. def hands(x,y):#手
    174. color((255,155,192))
    175. pu()
    176. goto(x,y)
    177. pd()
    178. seth(-160)
    179. circle(300,15)
    180. pu()
    181. seth(90)
    182. fd(15)
    183. seth(0)
    184. fd(0)
    185. pd()
    186. seth(-10)
    187. circle(-20,90)
    188. pu()
    189. seth(90)
    190. fd(30)
    191. seth(0)
    192. fd(237)
    193. pd()
    194. seth(-20)
    195. circle(-300,15)
    196. pu()
    197. seth(90)
    198. fd(20)
    199. seth(0)
    200. fd(0)
    201. pd()
    202. seth(-170)
    203. circle(20,90)
    204. def foot(x,y):#脚
    205. pensize(10)
    206. color((240,128,128))
    207. pu()
    208. goto(x,y)
    209. pd()
    210. seth(-90)
    211. fd(40)
    212. seth(-180)
    213. color("black")
    214. pensize(15)
    215. fd(20)
    216. pensize(10)
    217. color((240,128,128))
    218. pu()
    219. seth(90)
    220. fd(40)
    221. seth(0)
    222. fd(90)
    223. pd()
    224. seth(-90)
    225. fd(40)
    226. seth(-180)
    227. color("black")
    228. pensize(15)
    229. fd(20)
    230. def tail(x,y):#尾巴
    231. pensize(4)
    232. color((255,155,192))
    233. pu()
    234. goto(x,y)
    235. pd()
    236. seth(0)
    237. circle(70,20)
    238. circle(10,330)
    239. circle(70,30)
    240. def setting(): #参数设置
    241. pensize(4)
    242. hideturtle()
    243. colormode(255)
    244. color((255,155,192),"pink")
    245. setup(840,500)
    246. speed(10)
    247. def main():
    248. setting() #画布、画笔设置
    249. nose(-100,100) #鼻子
    250. head(-69,167) #头
    251. ears(0,160) #耳朵
    252. eyes(0,140) #眼睛
    253. cheek(80,10) #腮
    254. mouth(-20,30) #嘴
    255. body(-32,-8) #身体
    256. hands(-56,-45) #手
    257. foot(2,-177) #脚
    258. tail(148,-155) #尾巴
    259. done() #结束
    260. main()