Python绘制爱心,用程序员的方式打开情书!

利用python turtle库绘制了一个爱心

话不多说,直接上代码:

from turtle import *
def curvemove():
    for i in range(200):
        color('red','pink')
        right(1)
        forward(1)        
        begin_fill()
color('red','pink')
left(140)
forward(111.65)
curvemove()
left(120)
curvemove()
forward(111.65)
end_fill()
done()

效果图:

爱心绘制结果图

喜欢的话,快拿去和你心爱的人表白吧!

发布了2 篇原创文章 · 获赞 8 · 访问量 275

猜你喜欢

转载自blog.csdn.net/weixin_44780332/article/details/104544675