您现在的位置是:课程教程文章
怎么用python画出心型
2023-12-18 21:06课程教程文章 人已围观

程序员表达爱的方式真是多种多样。比如,用python来画一个心型,献给梦中的情人,代码如下
from turtle import *
pensize(1)
pencolor('red')
fillcolor('pink')
speed(5)
up()
goto(-30, 100)
down()
begin_fill()
left(90)
circle(120,180)
circle(360,70)
left(38)
circle(360,70)
circle(120,180)
end_fill()
up()
goto(-100,-100)
down()效果图如下

推荐学习《python教程》
课程教程:怎么用python画出心型上一篇:熟练使用python需要多久
下一篇:没有了