写一段Python代码画一只蝙蝠
时间: 2023-03-15 14:19:21 浏览: 106
# 使用Python库 Turtle 画一只蝙蝠
import turtle# 设置画布大小
turtle.screensize(500, 500)# 设置画笔颜色
turtle.pencolor("black")# 画出蝙蝠的轮廓
turtle.penup()
turtle.goto(-200, 0)
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(-50, 0)
turtle.pendown()
turtle.circle(50)# 画出蝙蝠的眼睛
turtle.penup()
turtle.goto(-175, 0)
turtle.pendown()
turtle.circle(5)
turtle.penup()
turtle.goto(-125, 0)
turtle.pendown()
turtle.circle(5)# 画出蝙蝠的翅膀
turtle.penup()
turtle.goto(-200, -50)
turtle.pendown()
turtle.left(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(100)# 隐藏画笔
turtle.hideturtle()
阅读全文