用Python写出团徽代码
时间: 2023-11-19 22:59:02 浏览: 159
团徽.aep
我很乐意回答你的问题。以下是Python代码示例,可以生成团徽图案:
```python
import turtle
turtle.speed(0)
def draw_square(length):
for i in range(4):
turtle.forward(length)
turtle.right(90)
def draw_circle(radius):
turtle.circle(radius)
turtle.color("#FFC20E")
turtle.begin_fill()
draw_square(200)
turtle.end_fill()
turtle.penup()
turtle.goto(0,-50)
turtle.pendown()
turtle.color("red")
draw_circle(100)
turtle.penup()
turtle.goto(0,-70)
turtle.pendown()
turtle.color("#FFC20E")
draw_circle(80)
turtle.penup()
turtle.goto(0,-90)
turtle.pendown()
turtle.color("red")
draw_circle(60)
turtle.hideturtle()
turtle.done()
```
希望这个代码示例对你有帮助。如果还有其他问题,欢迎随时提出。
阅读全文