Python制作表白爱心合集
作者:木木子学python 发布时间:2022-07-13 05:53:43
标签:Python,表白
导语
"盘子里最后一块肉给你 一 冰激凌的第一口给你 一手机最后的10%电量给你!"
哈喽大家好!我是木木子,我要开始给大家放大招啦
你来之后,苦都不太苦,甜都特别甜
如果人类有尾巴的话,说起来有点不好意思 ,只要和你在一起,一定会止不住摇起来
我害怕你找不到我,所以我要藏在你心里
I love three things in the world.The sun,the moon and you.The sun for the day,the moon for the night,and you for ever.
浮世万千,吾爱有三。日,月与卿。日为朝,月为暮,卿为朝朝暮暮。
下面这几套表白小项目送给大家 希望大家喜欢
一、爱心表白:做我女朋友吧,行就行,不行我再想想办法
1)效果展示
2)附主程序
t=turtle.pen()
t=turtle
t.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')
#L
t.pensize(10)
t.goto(-50,0)
t.goto(-50,80)
t.up ()
#I
t.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()
#O
t.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)
#U
t.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 direction
pen.left(110)
# draw the left bottom part
while pen.heading() < 140:
# rotate & forward
pen.left(1)
pen.forward(2)
# move up
pen.forward(90)
# draw the left upper part
while pen.xcor() < 0:
pen.right(0.8)
pen.forward(1)
# go back to the starting point, and do the right part as a mirror
pen.up()
pen.goto(0, 0)
pen.down()
# set the direction
pen.setheading(70)
# draw the right bottom part
while pen.heading() > 40:
# Defining step by step curve motion
pen.right(1)
pen.forward(2)
# move up
pen.forward(90)
# draw the right upper part
while pen.xcor() > 0:
print(pen.xcor())
pen.left(0.8)
pen.forward(1)
# Ending the filling of the color
pen.end_fill()
三、爱心表白:君初相识,犹如故人归。天涯明月新,朝暮最相思
1)效果展示
2)附主程序
import turtle as t
def 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()
来源:https://juejin.cn/post/7055831585819459615


猜你喜欢
- 前言随着我们不断地在一个文件中添加新的功能, 就会使得文件变得很长。 即便使用了继承,也抑制不住类的成长。为了解决这一问题,我们可以将类存储
- 1. 数据库的概念1.1 数据库(Database)是统一管理的相关数据的集合。长期存储在计算机内,有结构的、集成的、可共享的、统一管理的数
- 重试指的是当加载出错时,有能力重新发起加载组件的请求。异步组件加载失败后的重试机制,与请求服务端接口失败后的重试机制一样。所以,先来讨论接口
- 概要基于 golang Gin 框架开发 web 服务时, 需要时不时的 go build , 然后重启服务查看运行结果.go build
- 一、python这么多版本如何选择?作为初学者,只需知道 Python 分 Python 2.x 和 Python 3.x 两大版本就可以了
- datetime 和 smalldatetime 代表日期和一天内的时间的日期和时间数据类型。 Microsoft SQL Server 用
- 本文实例讲述了Thinkphp5.0框架视图view的循环标签用法。分享给大家供大家参考,具体如下:volist标签:<!-- 使用v
- 正在看的ORACLE教程是:Oracle 8x监控sysdba角色用户登陆情况。在Oracle 8i版本之前,使用internal
- “到底是什么将艺术和设计分开的?”这样一个话题听起来费解,长时间以来, 也已经被讨论过无数次。艺术家和设计师都是通过共通的知识和素养来创造视
- 所谓贪婪匹配就是匹配重复字符是尽可能多的匹配,比如:"aaaaa".match(/a+/); //["aaaa
- 为了得到更好的网络,学习率通常是要调整的,即刚开始用较大的学习率来加快网络的训练,之后为了提高精确度,需要将学习率调低一点。如图所示,步长(
- 五一在家写的,和大家分享,支持所有浏览器,添加了左侧菜单点击变色效果<!DOCTYPE html PUBLIC "-//W3
- 代码执行结构为顺序结构、选择结构、循环结构。python判断选择结构【if】if 判断条件 #进行判断条件满足之后执行下方语句 执行语句el
- 绘制一个菱形四边形,边长为 200 像素。方法1和2绘制了内角为60和120度的菱形,方法3绘制了内角为90度的菱形。方法1
- 前言了解 Python 的都知道 Pyinstaller 可以将 .py 文件打包成 windows 下可执行的 .exe 文件, 但是在我
- 在tensorflow中,默认指定占用所有的GPU,如需指定占用的GPU,可以在命令行中:export CUDA_VISIBLE_DEVIC
- 在做一个在线交流的网站时,有个问题很令我头疼,就是关于实时统计在线用户的问题,客户要求:统计当前在线人数、游客人数、会员人数、在线用户列表,
- 目录前言cv2.drawMarker()函数说明参数说明利用鼠标回调函数交互式画点例1,简单的例子例2,删除功能总结前言这里所谓画点的意思是
- Tuple 叫做 tuple,用小括号、或者无括号来表述,是一连串有顺序的数字。a_tuple = (12, 3, 5, 15 , 6)an
- 点乘和矩阵乘的区别: 1)点乘(即“ * ”) ---- 各个矩阵对应元素做乘法若 w 为 m*1 的矩阵,x