如何用python turtle画奥运五环

2021-11-07 体育 129阅读
1 import turtle #导入turtle模块
2 turtle.color("blue") #定义颜色
3 turtle.penup() #penup和pendown()设置画笔抬起或放下时是否绘制直线
4 turtle.goto(-110,-25) #初始位置以中心坐标为(0,0)
5 turtle.pendown()
6 turtle.circle(45) #绘制圆的半径
7
8 turtle.color("black")
9 turtle.penup()
10 turtle.goto(0,-25)
11 turtle.pendown()
12 turtle.circle(45)
13
14 turtle.color("red")
15 turtle.penup()
16 turtle.goto(110,-25)
17 turtle.pendown()
18 turtle.circle(45)
19
20 turtle.color("yellow")
21 turtle.penup()
22 turtle.goto(-55,-75)
23 turtle.pendown()
24 turtle.circle(45)
25
26 turtle.color("green")
27 turtle.penup()
28 turtle.goto(55,-75)
29 turtle.pendown()
30 turtle.circle(45)
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com