turtle画重庆财经学院大门
时间: 2023-08-09 10:05:12 浏览: 294
好的,以下是使用Python的turtle画出重庆财经学院大门的代码:
```python
import turtle
# 设置画笔宽度和颜色
turtle.pensize(5)
turtle.pencolor("black")
# 画左边的门柱和门
turtle.penup()
turtle.goto(-200, 0)
turtle.pendown()
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(100)
# 画右边的门柱和门
turtle.penup()
turtle.goto(100, 0)
turtle.pendown()
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(100)
# 画门的横梁和圆形门环
turtle.penup()
turtle.goto(-100, 100)
turtle.pendown()
turtle.forward(200)
turtle.penup()
turtle.goto(-40, 60)
turtle.pendown()
turtle.circle(20)
# 画门的校名和校徽
turtle.penup()
turtle.goto(-100, -50)
turtle.pendown()
turtle.write("重庆财经学院", font=("Arial", 20, "normal"))
turtle.penup()
turtle.goto(-50, -150)
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(-50, -125)
turtle.pendown()
turtle.write("财", font=("Arial", 30, "bold"))
# 隐藏画笔
turtle.hideturtle()
turtle.done()
```
运行代码后,即可看到turtle绘制出的重庆财经学院大门的效果。如果需要更改画笔的颜色和宽度,或者调整门的大小和位置,可以修改代码中的相关参数。
阅读全文