python用turtle画字母XNQ
时间: 2023-10-18 20:04:39 浏览: 108
python画图-使用Python+turtle实现画太阳花.zip
好的,下面是用turtle库在python中画出字母XNQ的代码:
```
import turtle
# 画X
turtle.pensize(5)
turtle.color("blue")
turtle.penup()
turtle.goto(-50, 50)
turtle.pendown()
turtle.right(45)
turtle.forward(100)
turtle.penup()
turtle.goto(-50, 50)
turtle.pendown()
turtle.left(90)
turtle.forward(100)
# 画N
turtle.penup()
turtle.goto(50, 50)
turtle.pendown()
turtle.right(135)
turtle.forward(100)
turtle.left(135)
turtle.forward(50)
turtle.right(135)
turtle.forward(100)
# 画Q
turtle.penup()
turtle.goto(175, 50)
turtle.color("red")
turtle.pendown()
turtle.circle(50)
turtle.done()
```
希望这段代码能够帮到你,如果还有其他问题,可以继续问我哦!
阅读全文