python turtle表白小姐姐

使用python中的 turtle海龟库写表白代码

快去发给你心爱的人吧!

效果图:

在这里插入图片描述

代码

import time
import turtle as t
t.speed(10)
t.pensize(4)

t.home()
t.left(30)
t.circle(60, 300)
p = t.position()

t.up()
t.goto(-10, 80)
t.down()
t.right(60)
t.circle(10, 80)
t.up()
t.goto(-10, 50)
t.down()
t.begin_fill()
t.fillcolor("black")
t.circle(5)
t.end_fill()

t.begin_fill()
t.fillcolor("white")
t.circle(4)
t.end_fill()


t.up()
t.goto(-60, 70)
t.down()
t.left(20)
t.forward(10)
t.up()
t.goto(-50, 50)
t.down()
t.begin_fill()
t.fillcolor("black")
t.circle(5)
t.end_fill()

t.begin_fill()
t.fillcolor("white")
t.circle(4)
t.end_fill()

t.up()
t.goto(-65, 30)
t.down()
t.begin_fill()
t.color("#ff5eb1")
t.circle(5)
t.end_fill()

t.up()
t.goto(5, 30)
t.down()
t.begin_fill()
t.color("#ff5eb1")
t.circle(5)
t.end_fill()


t.pencolor("black")
t.up()
t.goto(-40, 20)
t.down()
t.right(90)
t.circle(10, 160)


t.up()
t.goto(p[0]-15, p[1]+10)
t.down()
t.left(150)
t.circle(70, 70)
t.left(100)
t.circle(40, 40)
t.forward(10)
t.left(176)
t.circle(240, 20)
p2 = t.position()


t.up()
t.goto(p[0]+60, p[1])
t.down()
t.left(30)
t.forward(20)
t.circle(-20, 100)
t.right(95)
t.forward(30)

t.up()
t.goto(p2[0]+80, p2[1])
t.down()
t.right(25)
t.circle(260, 18)

t.up()
t.goto(-74, 160)
t.down()
a = t.position()
j = 1
text = "小姐姐"
for txt in text:
    t.write(txt, font=("Arial", 15, "bold"))
    t.up()
    t.goto(a[0]+(j*30), a[1])
    t.down()
    j += 1
    time.sleep(0.05)

text = "可以做我女朋友吗~~~"
j = 1
t.up()
t.goto(-174, 135)
t.down()
a = t.position()
for txt in text:
    t.write(txt, font=("Arial", 15, "bold"))
    t.up()
    t.goto(a[0]+(j*30), a[1])
    t.down()
    j += 1
    time.sleep(0.05)


t.up()
t.goto(70, -50)
t.down()
t.pencolor("red")
t.setheading(0)
t.begin_fill()
t.color("red")
t.left(45)
t.forward(40)
t.circle(20, 180)
t.right(90)
t.circle(20, 180)
t.forward(40)
t.end_fill()

t.ht()
t.done()

—结束----
仅学习。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值