Python如何制作表白爱心合集
发表于:2024-09-25 作者:千家信息网编辑
千家信息网最后更新 2024年09月25日,这篇文章将为大家详细讲解有关Python如何制作表白爱心合集,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。正文一、爱心表白:做我女朋友吧,行就行,不行我再想想办法1
千家信息网最后更新 2024年09月25日Python如何制作表白爱心合集
这篇文章将为大家详细讲解有关Python如何制作表白爱心合集,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
正文
一、爱心表白:做我女朋友吧,行就行,不行我再想想办法
1)效果展示
2)附主程序
t=turtle.pen()t=turtlet.up()t.goto(0,150)t.down()t.color('pink')t.begin_fill()t.fillcolor('pink')t.speed(1)t.left(45)t.forward(150)t.right(45)t.forward(100)t.right(45)t.forward(100)t.right(45)t.forward(100)t.right(45)t.forward(250+math.sqrt(2)*100)t.right (90)t.speed(2)t.forward(250+100*math.sqrt(2))t.right(45)t.forward(100)t.right(45)t.forward(100)t.right(45)t.forward(100)t.right(45)t.forward(150)t.end_fill()t.goto(-10,0)t.pencolor('white')#Lt.pensize(10)t.goto(-50,0)t.goto(-50,80)t.up ()#It.goto(-100,0)t.down()t.goto(-160,0)t.goto(-130,0)t.goto(-130,80)t.goto(-160,80)t.goto(-100,80)t.up()#Ot.goto(10,25)t.down()t.right(45)t.circle(25,extent=180)t.goto(60,55)t.circle(25,extent=180)t.goto(10,25)t.up()t.goto(75,80)t.down()t.goto(100,0)t.goto(125,80)t.up()t.goto(180,80)t.down()t.goto(140,80)t.goto(140,0)t.goto(180,0)t.up()t.goto(180,40)t.down()t.goto(140,40)#Ut.up()t.goto(-40,-30)t.down()t.goto(-40,-80)t.circle(40,extent=180)t.goto(40,-30)t.hideturtle()a=input()
二、爱心表白:????有两个心愿:你在身边,在你身边
1)效果展示
2)附主程序
pen = turtle.Turtle()pen.hideturtle()pen.fillcolor('pink')pen.begin_fill()# set the starting directionpen.left(110)# draw the left bottom partwhile pen.heading() < 140: # rotate & forward pen.left(1) pen.forward(2)# move uppen.forward(90)# draw the left upper partwhile pen.xcor() < 0: pen.right(0.8) pen.forward(1)# go back to the starting point, and do the right part as a mirrorpen.up()pen.goto(0, 0)pen.down()# set the directionpen.setheading(70)# draw the right bottom partwhile pen.heading() > 40: # Defining step by step curve motion pen.right(1) pen.forward(2)# move uppen.forward(90)# draw the right upper partwhile pen.xcor() > 0: print(pen.xcor()) pen.left(0.8) pen.forward(1)# Ending the filling of the colorpen.end_fill()
三、爱心表白:君初相识,犹如故人归。天涯明月新,朝暮最相思
1)效果展示
2)附主程序
import turtle as tdef heart(x,y,z): # 绘制爱心 t.pensize(2) t.pencolor("black") if z == 1: t.fillcolor("red") elif z == 0: t.fillcolor("pink") t.begin_fill() #左半边 t.penup() t.goto(x,y) t.pendown() t.circle(50,180) t.circle(180,37) t.left(46) #右半边 t.circle(180,37) t.circle(50, 182) t.end_fill()def arrow1(x,y): t.pensize(5) t.pencolor("black") t.fillcolor("brown") t.penup() t.goto(x, y) t.pendown() t.setheading(210) t.forward(150) t.begin_fill() t.left(30) t.forward(20) t.right(30) t.forward(50) t.right(150) t.forward(20) t.left(120) t.forward(20) t.right(150) t.forward(50) t.right(30) t.forward(20) t.end_fill()def arrow2(x, y): t.pensize(5) t.pencolor("black") t.fillcolor("brown") t.penup() t.goto(x, y) t.pendown() t.begin_fill() t.setheading(30) t.forward(100) t.left(90) t.forward(8) t.right(120) t.forward(16) t.right(120) t.forward(16) t.right(120) t.forward(8) t.end_fill()def main(): t.setheading(90) heart(50, 130, 0) t.setheading(120) heart(0, 100, 1) arrow1(-20, 60) arrow2(100, 130) t.hideturtle() t.exitonclick()
关于"Python如何制作表白爱心合集"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
爱心
主程序
效果
篇文章
合集
制作
半边
更多
不行
不错
实用
两个
内容
办法
天涯
女朋友
心愿
故人
文章
明月
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
淄博服装管理软件开发公司
ef core 数据库编码
网络安全博览会上开眼界
计算机网络技术职业有什么
软件开发能干多少年
学软件开发在外地发展
服务器管理未激活
上饶租房软件开发
软件开发教育方向
移动电信代理服务器
维普属于什么类型的数据库
档案网络安全体系建设方案
微信一直显示服务器正在运行
连接数据库失败请检查
泰拉瑞亚服务器一直显示连接
江苏软件开发技术学校
做网站开发为什么要用服务器
浩辰cAD显示数据库连接失败
预防和保护青少年网络安全
数据库自动跨服务器备份
私有威讯云服务器部署
软件开发中的六大原则
平面设计与网络技术有什么区别
少骨数据库
郑州c语言软件开发大概多少钱
承德油专计算机网络技术
电子信息网络技术是干什么的
学计算机网络技术是干嘛的
hax云服务器 梯子
java 桌面数据库