用Python实现表白代码,程序员还能这么玩?


前言

不知何时,只要说到程序员,脑海中就浮现出刻板印象,标配穿搭:格子衫,牛仔裤,黑框眼镜。当然秃顶也是必须的,更狠的吐槽还有邋里邋遢,不懂浪漫,不知人情世故!开始可能只是幽默玩笑,后面慢慢就越传越多,大家便信以为真!

可是程序员真的是这样吗?随着现在编程这个行业的普遍高薪收入,程序员又成为大家关注的焦点,深入的了解后,发现程序员其实是很可爱的一个群体。
他们有着自己标新立异的想法和活跃的思维,他们用指间汇编着这个精彩的世界。他们有时会很丧,却又很快的充满能量去面对工作和生活,他们有时话会很少,因为他们知道自己肩上的担子很重,他们用双手小心翼翼的呵护着亲人,爱人的幸福。

用自己的思维去让这个世界更美好!都说他们不懂浪漫,但你们是否见过他们遇见爱情的样子!

以下从网上整理了一些告白代码,让我们一起来看看程序员的浪漫吧!只属于程序员的浪漫。
在这里插入图片描述


一、浪漫玫瑰花

在这里插入图片描述
实现代码:

from turtle import *
import time
 
setup(1000,800,0,0)
speed(0)
penup()
seth(90)
fd(340)
seth(0)
pendown()
 
speed(5)
begin_fill()
fillcolor('red')
circle(50,30)
 
for i in range(10):
    fd(1)
    left(10)
 
circle(40,40)
 
for i in range(6):
    fd(1)
    left(3)
 
circle(80,40)
 
for i in range(20):
    fd(0.5)
    left(5)
 
circle(80,45)
 
for i in range(10):
    fd(2)
    left(1)
 
circle(80,25)
 
for i in range(20):
    fd(1)
    left(4)
 
circle(50,50)
 
time.sleep(0.1)
 
circle(120,55)
 
speed(0)
 
seth(-90)
fd(70)
 
right(150)
fd(20)
 
left(140)
circle(140,90)
 
left(30)
circle(160,100)
 
left(130)
fd(25)
 
penup()
right(150)
circle(40,80)
pendown()
 
left(115)
fd(60)
 
penup()
left(180)
fd(60)
pendown()
 
end_fill()
 
right(120)
circle(-50,50)
circle(-20,90)
 
speed(1)
fd(75)
 
speed(0)
circle(90,110)
 
penup()
left(162)
fd(185)
left(170)
pendown()
circle(200,10)
circle(100,40)
circle(-52,115)
left(20)
circle(100,20)
circle(300,20)
speed(1)
fd(250)
 
penup()
speed(0)
left(180)
fd(250)
circle(-300,7)
right(80)
circle(200,5)
pendown()
 
left(60)
begin_fill()
fillcolor('green')
circle(-80,100)
right(90)
fd(10)
left(20)
circle(-63,127)
end_fill()
 
penup()
left(50)
fd(20)
left(180)
 
pendown()
circle(200,25)
 
penup()
right(150)
 
fd(180)
 
right(40)
pendown()
begin_fill()
fillcolor('green')
circle(-100,80)
right(150)
fd(10)
left(60)
circle(-80,98)
end_fill()
 
penup()
left(60)
fd(13)
left(180)
 
pendown()
speed(1)
circle(-200,23)
 
exitonclick()

二、粉嫩爱心

在这里插入图片描述
实现代码:

'''不正经爱心'''
#coding=utf-8
import turtle
import time
 
 
def draw_circle():
    for i in range(400):
        turtle.right(0.5)
        turtle.forward(1)
 
 
def draw_love():
    #    turtle.color('red','darkred')
    #    turtle.pensize(1)
    turtle.pen(fillcolor="pink", pencolor="red", pensize=8)
    turtle.speed(2000)
    turtle.goto(0, 0)
    turtle.begin_fill()
    turtle.left(140)
    turtle.forward(224)
    draw_circle()
    turtle.left(120)
    draw_circle()
    turtle.forward(224)
    turtle.end_fill()
    turtle.write("I Love you")
    time.sleep(2)
    turtle.up()
    turtle.goto(150, 20)
    turtle.color('black')
    turtle.write('纵然万劫不复,纵然相思入骨,我待你依旧如初!', font=("微软雅黑", 18, "normal"))
    time.sleep(2)
 
 
def draw_abc():
    turtle.fillcolor("pink")
    turtle.pencolor("red")
    turtle.pensize(10)
    turtle.speed(1)
    turtle.up()
    turtle.goto(0, -50)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(45)
    turtle.end_fill()
    time.sleep(2)
 
 
def word():
    turtle.up()
    turtle.goto(-100, 200)
    turtle.color("red")
    turtle.pensize(4)
    #   turtle.down()
    turtle.write('宝贝,5.20快乐!', font=("隶书", 18, "bold"))
    time.sleep(10)
 
 
draw_love()
draw_abc()
word()

三、丘比特一箭穿心

在这里插入图片描述
程序代码:

import turtle as t
t.color('red','pink')
t.begin_fill()
t.width(5)
t.left(135)
t.fd(100)
t.right(180)
t.circle(50,-180)
t.left(90)
t.circle(50,-180)
t.right(180)
t.fd(100)
t.pu()
t.goto(50,-30)
t.pd()
t.right(90)
t.fd(100)
t.right(180)
t.circle(50,-180)
t.left(90)
t.circle(50,-180)
t.right(180)
t.fd(100)
t.end_fill()
t.hideturtle()
t.pu()
t.goto(250,-70)
t.pd()
t.color('black')
t.width(5)
t.left(70)
t.fd(50)
t.fd(-50)
t.left(70)
t.fd(50)
t.fd(-50)
t.left(145)
t.fd(20)
t.left(145)
t.fd(50)
t.fd(-50)
t.left(70)
t.fd(50)
t.fd(-50)
t.left(145)
t.fd(20)
t.left(145)
t.fd(50)
t.fd(-50)
t.left(70)
t.fd(50)
t.fd(-50)
t.left(145)
t.width(3)
t.fd(220)
t.right(90)
t.pu()
t.fd(10)
t.pd()
t.left(90)
t.circle(10,180)
t.circle(10,-90)
t.right(90)
t.fd(-10)
t.pu()
t.fd(90)
t.left(90)
t.fd(10)
t.left(90)
t.pd()
t.circle(10,180)
t.circle(10,-90)
t.left(90)
t.fd(100)
t.begin_fill()
t.left(30)
t.fd(15)
t.right(35)
t.fd(50)
t.right(150)
t.fd(50)
t.right(62)
t.fd(25)
t.end_fill()
t.done()

四、发射爱心小人

在这里插入图片描述
实现代码:

# 2.14
from turtle import *
from time import sleep
 
 
def go_to(x, y):
    up()
    goto(x, y)
    down()
 
 
def head(x, y, r):
    go_to(x, y)
    speed(1)
    circle(r)
    leg(x, y)
 
 
def leg(x, y):
    right(90)
    forward(180)
    right(30)
    forward(100)
    left(120)
    go_to(x, y - 180)
    forward(100)
    right(120)
    forward(100)
    left(120)
    hand(x, y)
 
 
def hand(x, y):
    go_to(x, y - 60)
    forward(100)
    left(60)
    forward(100)
    go_to(x, y - 90)
    right(60)
    forward(100)
    right(60)
    forward(100)
    left(60)
    eye(x, y)
 
 
def eye(x, y):
    go_to(x - 50, y + 130)
    right(90)
    forward(50)
    go_to(x + 40, y + 130)
    forward(50)
    left(90)
 
 
def big_Circle(size):
    speed(20)
    for i in range(150):
        forward(size)
        right(0.3)
 
 
def line(size):
    speed(1)
    forward(51 * size)
 
 
def small_Circle(size):
    speed(10)
    for i in range(210):
        forward(size)
        right(0.786)
 
 
def heart(x, y, size):
    go_to(x, y)
    left(150)
    begin_fill()
    line(size)
    big_Circle(size)
    small_Circle(size)
    left(120)
    small_Circle(size)
    big_Circle(size)
    line(size)
    end_fill()
 
 
def main():
    pensize(2)
    color('red', 'pink')
    head(-120, 100, 100)
    heart(250, -80, 1)
    go_to(200, -300)
    write("To: 送给智慧与美貌并存的小仙女!", move=True, align="left", font=("楷体", 20, "normal"))
    done()
 
main()

总结

祝大家都找到属于自己的幸运呦~
在这里插入图片描述

关于Python技术储备

学好 Python 不论是就业还是做副业赚钱都不错,但要学会 Python 还是要有一个学习规划。最后大家分享一份全套的 Python 学习资料,给那些想学习 Python 的小伙伴们一点帮助!

👉CSDN大礼包:《Python入门资料&实战源码&安装工具】免费领取安全链接,放心点击

一、Python所有方向的学习路线

Python所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面。
在这里插入图片描述

二、Python基础学习视频

② 路线对应学习视频

还有很多适合0基础入门的学习视频,有了这些视频,轻轻松松上手Python~在这里插入图片描述
在这里插入图片描述

③练习题

每节视频课后,都有对应的练习题哦,可以检验学习成果哈哈!
在这里插入图片描述
因篇幅有限,仅展示部分资料

三、精品Python学习书籍

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述

四、Python工具包+项目源码合集

①Python工具包

学习Python常用的开发软件都在这里了!每个都有详细的安装教程,保证你可以安装成功哦!
在这里插入图片描述

②Python实战案例

光学理论是没用的,要学会跟着一起敲代码,动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。100+实战案例源码等你来拿!
在这里插入图片描述

③Python小游戏源码

如果觉得上面的实战案例有点枯燥,可以试试自己用Python编写小游戏,让你的学习过程中增添一点趣味!
在这里插入图片描述

五、面试资料

我们学习Python必然是为了找到高薪的工作,下面这些面试题是来自阿里、腾讯、字节等一线互联网大厂最新的面试资料,并且有阿里大佬给出了权威的解答,刷完这一套面试资料相信大家都能找到满意的工作。
在这里插入图片描述
在这里插入图片描述

六、Python兼职渠道

而且学会Python以后,还可以在各大兼职平台接单赚钱,各种兼职渠道+兼职注意事项+如何和客户沟通,我都整理成文档了。
在这里插入图片描述
在这里插入图片描述
这份完整版的Python全套学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值