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
0
投稿
猜你喜欢
- 1. fixture的作用域1.1 scope通过前面文章的介绍,我们知道@pytest.fixture()有一个scope参数,并且有五个
- 最近在工作中,遇到了数据合并、连接的问题,故整理如下,供需要者参考~一、concat:沿着一条轴,将多个对象堆叠到一起concat方法相当于
- 在 * 站中,用户每次请求一个页面,服务器都会执行以下操作:查询数据库,渲染模板,执行业务逻辑,最后生成用户可查看的页面。这会消耗大量的资源
- 北京邮电大学 张剑XML的局限性目前,许多Web网站的内容数据都存放在数据库或数据文件中。对于Web程序开发人员来说,如果要想把有用的信息从
- %matplotlib inline是一个魔法函数(Magic Functions)。官方给出的定义是:IPython有一组预先定义好的所谓
- 一.雅黑设计理念 雅黑字体是为微软公司设计的屏幕显示汉字。它具有个性独特、结体优美、识别性强、块状效果好、显示清晰等优点。在当今数字化时代更
- 调用很简单 Readkid.motion.tween(target,duration, vars)target: 要缓动的DOM对象dura
- 在抓取网络数据的时候,有时会用正则对结构化的数据进行提取,比如 href="https://www.1234.com"等
- 动态变量名赋值在使用 tkinter 时需要动态生成变量,如动态生成 var1...var10 变量。使用 exec 动态赋值exec 在
- 本次分析基于 CPython 解释器,python3.x版本在python2时代,整型有 int 类型和 long 长整型,长整型不存在溢出
- 在开发C/S结构的大型数据库应用软件时,一般情况下,软件开发人员和数据库设计人员并不是同一个人,这就需要协商好一些即可由程序设
- python共现矩阵实现最近在学习python词库的可视化,其中有一个依据共现矩阵制作的可视化,感觉十分炫酷,便以此复刻。项目背景本人利用爬
- 本文实例讲述了Python使用matplotlib的pie函数绘制饼状图功能。分享给大家供大家参考,具体如下:matplotlib具体安装方
- 你喜欢在博客文章中使用图片吗?是的,如果不是很麻烦的话,相信大家都不会介意放上几张漂亮的图片来点缀一下内容的,不过你的图片可能会导致下面的两
- 在SQL Server 2008里安装审计,步骤如下:1. 给每个SQL Server 2008具体实例创建一个SQL Server审计2.
- 此文刊登在《程序员》三月期,有删改提到安全问题,首先想到应付这些问题的应该是系统管理员以及后台开发工程师们,而前端开发工程师似乎离这些问题很
- MySQL安全性指南(2) 作 者: 晏子2.1.3 数据库和表权限下列权限运用于数据库和表上的操作。ALTER允许你使用ALTER TAB
- 一、遍历通过for。。。in。。。的语法结构,我们可以遍历字符串、列表、元组、字典等数据结构。1、字符串遍历a_str = "he
- 对于SQL的Join,在学习起来可能是比较乱的。我们知道,SQL的Join语法有很多inner的,有outer的,有left的,有时候,对于
- 本文为大家分享了virtualenv建立多个Python独立虚拟开发环境,供大家参考,具体内容如下1、安装virtualenv:pip in