直接上代码。如下
import turtle#我们在这里导入python中的画画工具包 import time def LittleHeart(): for i in
range(200): turtle.right(1) turtle.forward(2) love=input('Please enter a
sentence of love,otherwise the default is "I Love You":\n') me=input('Please
enter pen name, otherwise the default do not execute:\n') if love=='': love='I
Love you' turtle.setup(width=900,height=600)#爱心的画布的大小
turtle.color('red','pink')#爱心的颜色及外边笔的颜色 turtle.pensize(5)#画笔的粗细
turtle.speed(1000000) turtle.up() turtle.hideturtle() turtle.goto(0,-180)
turtle.showturtle() turtle.down() turtle.speed(5) turtle.begin_fill()
turtle.left(140) turtle.forward(224) LittleHeart() turtle.left(120)
LittleHeart() turtle.forward(224) turtle.end_fill() turtle.pensize(5)
turtle.up() turtle.hideturtle() turtle.goto(0,0) turtle.showturtle()
turtle.color('#CD5C5C','pink')
turtle.write(love,font=('gungsuh',30,),align="center") turtle.up()
turtle.hideturtle() if me !='': turtle.color('black', 'pink') time.sleep(2)
turtle.goto(180,-180) turtle.showturtle() turtle.write(me, font=(20,),
align="center", move=True) window=turtle.Screen() window.exitonclick()
结果为如下:

技术
©2019-2020 Toolsou All rights reserved,
过拟合和欠拟合的形象解释2021 美赛时间安排表Springboot之JPA常用查询方法中国月球车“月兔二号”在月球发现一块奇怪岩石PS制作登录界面C语言程序设计课程设计 之《学生成绩管理系统》消息质量平台系列文章|全链路排查篇年薪20万属于什么水平?答案让人扎心!王者荣耀背景故事整合Jsp+Ajax+Servlet+Mysql实现增删改查(一)