使用Python画爱心
importturtle
#定义函数画圆圈,200度
defcurvemove():
foriinrange(100):
turtle.right(2)
turtle.forward(2)
turtle.speed(10)
#设置填充颜色及画笔
turtle.color('red', ('#F05B72'))
turtle.pensize(3)
turtle.hideturtle()#隐藏画笔形状
turtle.speed(5)
turtle.begin_fill()#开始填充
turtle.left(140)
turtle.forward(111.65)
curvemove()
turtle.left(120)
curvemove()
turtle.forward(111.65)
turtle.end_fill()
turtle.color(('#F05B72'),'red')
turtle.begin_fill()
turtle.penup()
turtle.goto(60,)
turtle.pendown()
turtle.right(80)
turtle.forward(111.65)
curvemove()
turtle.left(120)
curvemove()
turtle.forward(111.65)
turtle.end_fill()
turtle.color('red','red')
turtle.begin_fill()
turtle.hideturtle()
turtle.penup()
turtle.goto(-150,20)
turtle.pendown()
turtle.pensize(5)
turtle.right(20)
turtle.right(60)
turtle.forward(15)
turtle.right(120)
turtle.forward(40)
turtle.right(60)
turtle.forward(14)
turtle.left(60)
turtle.forward(375)
turtle.left(90)
turtle.forward(10)
turtle.right(110)
turtle.forward(30)
turtle.right(140)
turtle.forward(30)
turtle.right(110)
turtle.forward(10)
turtle.left(90)
turtle.forward(375)
turtle.left(60)
turtle.forward(14)
turtle.right(60)
turtle.forward(40)
turtle.right(120)
turtle.forward(15)
turtle.end_fill()
turtle.penup()
turtle.goto(10.5,85)
turtle.color("violet")
turtle.write("L O V E", \
font=('Dutch801 XBd BT', \
20,'normal'))
turtle.done()
turtle.done()
领取专属 10元无门槛券
私享最新 技术干货