二级python——绘制七彩圆圈

import turtle


colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'indigo']
for i in range(7):
    c = colors[i]
    turtle.color(c, c)
    turtle.begin_fill()
    turtle.rt(360/7)
    turtle.circle(50)
    turtle.end_fill()

turtle.done()

在这里插入图片描述

发布了198 篇原创文章 · 获赞 48 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44478378/article/details/104495331