turtle库绘制奥运五环
Posted haisenberg
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了turtle库绘制奥运五环相关的知识,希望对你有一定的参考价值。
import turtle turtle.pensize(10) turtle.color("blue") #定义颜色 turtle.penup() #penup和pendown()设置画笔抬起或放下时是否绘制直线 turtle.goto(-110,-25) #初始位置以中心坐标为(0,0) turtle.pendown() turtle.circle(45) #绘制圆的半径 turtle.pensize(10) turtle.color("black") turtle.penup() turtle.goto(0,-25) turtle.pendown() turtle.circle(45) turtle.pensize(10) turtle.color("red") turtle.penup() turtle.goto(110,-25) turtle.pendown() turtle.circle(45) turtle.pensize(10) turtle.color("yellow") turtle.penup() turtle.goto(-55,-75) turtle.pendown() turtle.circle(45) turtle.pensize(10) turtle.color("green") turtle.penup() turtle.goto(55,-75) turtle.pendown() turtle.circle(45)
以上是关于turtle库绘制奥运五环的主要内容,如果未能解决你的问题,请参考以下文章