python五环_python (turtle)画五环

  • Post author:
  • Post category:python


实现代码:

import turtle         #导入turtle模块

turtle.width(10)       #笔的宽度

turtle.color(“blue”)       #笔的颜色

turtle.circle(50)       #画圆

turtle.penup()         #抬笔,这样,路径就不会画出来

turtle.goto(120,0)      #去坐标(120,0)

turtle.pendown()       #下笔

turtle.color(“black”)

turtle.circle(50)

turtle.penup()

turtle.goto(240,0)

turtle.pendown()

turtle.color(“red”)

turtle.circle(50)

turtle.penup()

turtle.goto(60,-50)

turtle.pendown()

turtle.color(“yellow”)

turtle.circle(50)

turtle.penup()

turtle.goto(180,-50)

turtle.pendown()

turtle.color(“green”)

turtle.circle(50)

原文:https://www.cnblogs.com/lygl/p/9374522.html



版权声明:本文为weixin_32210881原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。