Python用turtle画爱心丘比特之剑

**程序员的爱情,在Python中运用调用turtle库来根据函数画出爱心。**

from turtle import*
setup(750,500)
penup()
pensize(25)
pencolor("pink")
fd(-230)
seth(90)
pendown()
circle(-50,180)
circle(50,-180)
circle(75,-50)
circle(-190,-45)
penup()
fd(185)
seth(180)
fd(120)
seth(90)
pendown()
circle(-75,-50)
circle(190,-45)
penup()
fd(184)
seth(0)
fd(80)
seth(90)
pendown()
circle(-50,180)
circle(50,-180)
circle(75,-50)
circle(-190,-45)
penup()
fd(185)
seth(180)
fd(120)
seth(90)
pendown()
circle(-75,-50)
circle(190,-45)
penup()
fd(150)
seth(180)
fd(300)
pencolor("red")
pensize(10)
pendown()
fd(-500)
seth(90)
fd(30)
fd(-60)
seth(30)
fd(60)
seth(150)
fd(60)
done()

Python用turtle画爱心丘比特之剑_第1张图片

参考:

https://www.linuxidc.com/Linux/2019-03/157603.htm

你可能感兴趣的:(#,Python,Anaconda&conda)