当前位置:   article > 正文

python玫瑰花代码_绘制红色玫瑰花的python代码

绘制红色玫瑰花的python代码

如下:

  1. '''
  2. Created on Nov 18, 2017
  3. @author: QiZhao
  4. '''
  5. import turtle
  6. # 设置初始位置
  7. turtle.penup()
  8. turtle.left(90)
  9. turtle.fd(200)
  10. turtle.pendown()
  11. turtle.right(90)
  12. # 花蕊
  13. turtle.fillcolor("red")
  14. turtle.begin_fill()
  15. turtle.circle(10,180)
  16. turtle.circle(25,110)
  17. turtle.left(50)
  18. turtle.circle(60,45)
  19. turtle.circle(20,170)
  20. turtle.right(24)
  21. turtle.fd(30)
  22. turtle.left(10)
  23. turtle.circle(30,110)
  24. turtle.fd(20)
  25. turtle.left(40)
  26. turtle.circle(90,70)
  27. turtle.circle(30,150)
  28. turtle.right(30)
  29. turtle.fd(15)
  30. turtle.circle(80,90)
  31. turtle.left(15)
  32. turtle.fd(45)
  33. turtle.right(165)
  34. turtle.fd(20)
  35. turtle.left(155)
  36. turtle.circle(150,80)
  37. turtle.left(50)
  38. turtle.circle(150,90)
  39. turtle.end_fill()
  40. # 花瓣1
  41. turtle.left(150)
  42. turtle.circle(-90,70)
  43. turtle.left(20)
  44. turtle.circle(75,105)
  45. turtle.setheading(60)
  46. turtle.circle(80,98)
  47. turtle.circle(-90,40)
  48. # 花瓣2
  49. turtle.left(180)
  50. turtle.circle(90,40)
  51. turtle.circle(-80,98)
  52. turtle.setheading(-83)
  53. # 叶子1
  54. turtle.fd(30)
  55. turtle.le
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/621974
推荐阅读
相关标签
  

闽ICP备14008679号