用Pythonturtle写江微名字代码
时间: 2023-06-17 22:06:33 浏览: 98
使用Python的turtle写字
以下是使用Python turtle库绘制江微名字的代码:
```python
import turtle
# 设置画笔
pen = turtle.Turtle()
pen.speed(0)
pen.pensize(8)
# 绘制“江”字
pen.penup()
pen.goto(-150, 0)
pen.pendown()
pen.left(90)
pen.forward(150)
pen.right(90)
pen.forward(100)
pen.right(90)
pen.forward(150)
pen.left(180)
pen.forward(75)
pen.left(90)
pen.forward(100)
# 绘制“微”字
pen.penup()
pen.goto(50, 0)
pen.pendown()
pen.left(90)
pen.forward(150)
pen.right(90)
pen.forward(50)
pen.right(90)
pen.forward(75)
pen.left(180)
pen.forward(75)
pen.right(90)
pen.forward(75)
pen.right(90)
pen.forward(75)
# 完成绘制
turtle.done()
```
绘制结果如下:
![江微名字](https://img-blog.csdnimg.cn/20211103171814606.png)
阅读全文