生活随笔
收集整理的這篇文章主要介紹了
python表白
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
馬上就要520了,不少小伙伴們一定開始想盡各種辦法進(jìn)行表白了…那么身為奔跑在程序員道路上的我們也一定要有獨(dú)特的表白方法!
下面是一段表白代碼,請直接搬去用吧!!!
import turtle
import time
def hart_arc():for i
in range(200):turtle
.right
(1)turtle
.forward
(2)def move_pen_position(x
, y
):turtle
.hideturtle
() turtle
.up
() turtle
.goto
(x
, y
) turtle
.down
() turtle
.showturtle
() love
= input("請輸入表白話語:")
signature
= input("請簽署你的名字:")
date
=input("請寫上日期:")if love
== '':love
= 'I Love You'
turtle
.setup
(width
=800, height
=500)
turtle
.color
('red', 'pink')
turtle
.pensize
(3)
turtle
.speed
(2)
move_pen_position
(x
=0, y
=-180)
turtle
.left
(140) turtle
.begin_fill
()
turtle
.forward
(224)
hart_arc
()
turtle
.left
(120)
hart_arc
()
turtle
.forward
(224)turtle
.end_fill
() move_pen_position
(x
=70, y
=160)
turtle
.left
(185)
turtle
.circle
(-110,185)
turtle
.forward
(50)
move_pen_position
(x
=-180, y
=-180)
turtle
.left
(180)
turtle
.forward
(600)
move_pen_position
(0,50)
turtle
.hideturtle
()
turtle
.color
('#CD5C5C', 'pink')
turtle
.write
(love
, font
=('Arial', 20, 'bold'), align
="center")
if (signature
!= '') & (date
!= ''):turtle
.color
('red', 'pink')time
.sleep
(2)move_pen_position
(220, -180)turtle
.hideturtle
() turtle
.write
(signature
, font
=('Arial', 20), align
="center")move_pen_position
(220, -220)turtle
.hideturtle
() turtle
.write
(date
, font
=('Arial', 20), align
="center")
window
= turtle
.Screen
()
window
.exitonclick
()
轉(zhuǎn)載:https://www.cnblogs.com/Yanjy-OnlyOne/p/11319401.html
總結(jié)
以上是生活随笔為你收集整理的python表白的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。