python编写程序利用turtle库在绘图区绘制姓氏:陈
时间: 2023-06-06 11:07:38 浏览: 230
Python & Turtle练习:绘制各种图形(全部源代码)
5星 · 资源好评率100%
好的,请稍等片刻,我会为您生成相应的代码。
```
import turtle
def draw_chen():
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
turtle.left(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(180)
turtle.forward(100)
turtle.right(180)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.penup()
turtle.goto(0, 0)
turtle.speed(5)
draw_chen()
turtle.done()
```
请您复制上述代码,粘贴到您的Python环境中运行即可看到效果。
阅读全文