使用Python绘制一个雪容融

残奥马上要开始了,今天我们用Python turtle库绘制一个冬奥吉祥物“雪容融”吧。
废话不多说,直接上代码(核心代码):

  1. # 头部圆圈
  2. turtle.penup()
  3. turtle.goto(-145, 135)
  4. turtle.pensize(10)
  5. turtle.pencolor("#BB3529")
  6. turtle.fillcolor("#DA2D20")
  7. turtle.begin_fill()
  8. turtle.pendown()
  9. turtle.setheading(45)
  10. turtle.circle(-150, 45)
  11. turtle.forward(80)
  12. turtle.circle(-150, 180)
  13. turtle.forward(80)
  14. turtle.circle(-150, 135)
  15. turtle.end_fill()
  16. #花纹
  17. turtle.fillcolor("#FF9300")
  18. turtle.begin_fill()
  19. turtle.pensize(5)
  20. turtle.setheading(15)
  21. turtle.circle(-600, 28)
  22. turtle.pencolor("#FF9300")
  23. turtle.right(30)
  24. turtle.circle(-150, -35)
  25. turtle.setheading(180)
  26. turtle.forward(100)
  27. turtle.circle(150, 42)
  28. turtle.end_fill()
  29. turtle.pencolor("#DA2D20")
  30. turtle.penup()
  31. turtle.goto(-100, 160)
  32. turtle.fillcolor("#DA2D20")
  33. turtle.begin_fill()
  34. turtle.pendown()
  35. turtle.circle(4, 360)
  36. turtle.end_fill()
  37. turtle.penup()
  38. turtle.goto(-40, 169)
  39. turtle.fillcolor("#DA2D20")
  40. turtle.begin_fill()
  41. turtle.pendown()
  42. turtle.circle(4, 360)
  43. turtle.end_fill()
  44. turtle.penup()
  45. turtle.goto(20, 169)
  46. turtle.fillcolor("#DA2D20")
  47. turtle.begin_fill()
  48. turtle.pendown()
  49. turtle.circle(4, 360)
  50. turtle.end_fill()
  51. turtle.penup()
  52. turtle.goto(80, 163)
  53. turtle.fillcolor("#DA2D20")
  54. turtle.begin_fill()
  55. turtle.pendown()
  56. turtle.circle(4, 360)
  57. turtle.end_fill()

运行效果和完整代码请点击此处《使用Python Turtle绘制雪容融》前往好学好教在线Python编程平台,可以直接在网页上运行Python代码。

微信扫一扫,分享此文章

少儿编程教学平台

联系我们

微信

aguibo002

邮箱

haoxuehaojiao在163.com

Loading
我们已经收到您的信息,将尽快联系您!