python奥运五环编程代码
时间: 2023-11-17 16:03:50 浏览: 90
奥运五环代码
以下是Python实现奥运五环的代码:
```python
import turtle
# 画圆函数
def draw_circle(x, y, radius, color):
turtle.penup()
turtle.setposition(x, y)
turtle.pendown()
turtle.fillcolor(color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
# 画五环
draw_circle(-110, 0, 100, "blue")
draw_circle(110, 0, 100, "purple")
draw_circle(0, 0, 100, "red")
draw_circle(-220, -100, 100, "yellow")
draw_circle(220, -100, 100, "green")
# 隐藏画笔
turtle.hideturtle()
# 点击关闭窗口
turtle.exitonclick()
```
阅读全文