ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

简单python 表白代码

2021-01-17 21:01:30  阅读:1970  来源: 互联网

标签:turtle 表白 python 代码 penup setheading pendown forward circle


# 导入模块
import turtle

# 人
turtle.penup()
turtle.goto(-100, 100)
turtle.pendown()
turtle.color('yellow')
turtle.setheading(55)
turtle.circle(50, 280)
turtle.setheading(238)
turtle.forward(145)
turtle.setheading(-45)
turtle.circle(165, 85)
turtle.setheading(120)
turtle.forward(175)
turtle.penup()
turtle.goto(-120, 120)
turtle.pendown()
turtle.forward(25)
turtle.penup()
turtle.goto(-100, 140)
turtle.pendown()
turtle.forward(10)
turtle.penup()
turtle.goto(-110, 105)
turtle.pendown()
turtle.setheading(15)
turtle.circle(10, 60)
turtle.penup()
turtle.goto(-145, -105)
turtle.pendown()
turtle.setheading(-90)
turtle.forward(50)
turtle.penup()
turtle.goto(-100, -105)
turtle.pendown()
turtle.setheading(-90)
turtle.forward(50)
turtle.penup()
turtle.goto(-80, 65)
turtle.pendown()
turtle.setheading(30)
turtle.forward(65)
turtle.circle(10, 70)
turtle.forward(5)
turtle.circle(8, 60)
turtle.setheading(60)
turtle.circle(-5, 90)
turtle.setheading(-80)
turtle.forward(10)
turtle.setheading(30)
turtle.forward(18)
turtle.circle(-2, 180)
turtle.setheading(-150)
turtle.forward(19)
for i in range(1, 4, 1):
turtle.setheading(30)
turtle.forward(4)
turtle.circle(-2.2, 180)
turtle.forward(4.2)
turtle.setheading(170)
turtle.circle(-10, 36)
turtle.setheading(210)
turtle.forward(75)

# 心
turtle.penup()
turtle.goto(70, 90)
turtle.pendown()
turtle.color('red')
turtle.begin_fill()
turtle.fillcolor()
turtle.setheading(135)
turtle.forward(80)
turtle.circle(-40, 180)
turtle.setheading(45)
turtle.circle(-40, 180)
turtle.forward(80)
turtle.end_fill()

# 心中填字
turtle.penup()
turtle.goto(48, 155)
turtle.pendown()
turtle.color('yellow')
turtle.write('I Love You')

# 移动右下方填字
turtle.penup()
turtle.goto(200, -300)
turtle.pendown()
turtle.color('blue')
turtle.write('喜欢是棋逢对手,但爱是甘拜下风!')
turtle.hideturtle()
turtle.done()

标签:turtle,表白,python,代码,penup,setheading,pendown,forward,circle
来源: https://www.cnblogs.com/Redskaber/p/14290168.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有