【Python】利用turtle库画一个爱心气球

2024-01-17 17:15:57 浏览数 (2)

直接上代码

代码语言:javascript复制
from turtle import*
speed(0)
screensize(800,600)
pensize(1)
def curvemove():
    for i in range(200):
        right(1)
        forward(1)
color('red','red')
begin_fill()
left(120)
forward(111.65)
curvemove()
left(120)
curvemove()
forward(111.65)
end_fill()
for i in range(4):
    circle(40,80)
    circle(-40,80)
#clear()
done()

效果图

0 人点赞