ICode9

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

python----520单身狗

2022-02-05 20:05:05  阅读:207  来源: 互联网

标签:25 python fd ---- color 520 nose 90 circle


一、下载python3.7.3

下载python3.7.3 - 搜索 (bing.com)

(10条消息) python3.7安装教程_PtaQ的博客-CSDN博客_python3安装e

二、 编写python代码

import turtle as t
t.screensize(500, 500)
# 【头部轮廓】
t.pensize(5)
t.home()
t.seth(0)
t.pd()  #pendown
t.color('black')
t.circle(20, 80)  # 0
t.circle(200, 30)  # 1
t.circle(30, 60)  # 2
t.circle(200, 29.5)  # 3
t.color('black')
t.circle(20, 60)  # 4
t.circle(-150, 22)  # 5
t.circle(-50, 10)  # 6
t.circle(50, 70)  # 7
x_nose = t.xcor()
y_nose = t.ycor()
t.circle(30, 62)  # 8
t.circle(200, 15)  # 9
# 【鼻子】
t.pu() #penup
t.goto(x_nose, y_nose + 25)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【眼睛】
t.pu()
t.goto(x_nose + 48, y_nose + 55)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【耳朵】
t.pu()
t.color('#444444')
t.goto(x_nose + 100, y_nose + 110)
t.seth(182)
t.pd()
t.circle(15, 45) 
t.color('black')
t.circle(10, 15)  
t.circle(90, 70)  
t.circle(25, 110)  
t.rt(4)
t.circle(90, 70)  
t.circle(10, 15)  
t.color('#444444')
t.circle(15, 45) 
# 【身体】
t.pu()
t.color('black')
t.goto(x_nose + 90, y_nose - 30)
t.seth(-130)
t.pd()
t.circle(250, 28)  
t.circle(10, 140)  
t.circle(-250, 25)  
t.circle(-200, 25)  
t.circle(-50, 85)  
t.circle(8, 145)  
t.circle(90, 45)
t.circle(550, 5)  
# 【尾巴】
t.seth(0)
t.circle(60, 85) 
t.circle(40, 65) 
t.circle(40, 60)  
t.lt(150)  #left
t.circle(-40, 90)  
t.circle(-25, 100)  
t.lt(5)
t.fd(20)
t.circle(10, 60)  
# 【背部】
t.rt(80)  #right
t.circle(200, 35)
# 【项圈】
t.pensize(20)
t.color('#F03C3F')
t.lt(10)
t.circle(-200, 25)  
# 【爱心铃铛】
t.pu()
t.fd(18)
t.lt(90)
t.fd(18)
t.pensize(6)
t.seth(35)  #setheading
t.color('#FDAF17')
t.begin_fill()
t.lt(135)
t.fd(6)
t.right(180)  # 画笔掉头
t.circle(6, -180)
t.backward(8)
t.right(90)
t.forward(6)
t.circle(-6, 180)
t.fd(15)
t.end_fill()
# 【前小腿】
t.pensize(5)
t.pu()
t.color('black')
t.goto(x_nose + 100, y_nose - 125)
t.pd()
t.seth(-50)
t.fd(25)
t.circle(10, 150)
t.fd(25)
# 【后小腿】
t.pensize(4)
t.pu()
t.goto(x_nose + 314, y_nose - 125)
t.pd()
t.seth(-95)
t.fd(25)
t.circle(-5, 150)
t.fd(2)
t.hideturtle()

三、运行

 

 

 

 

 

标签:25,python,fd,----,color,520,nose,90,circle
来源: https://blog.csdn.net/m0_51152186/article/details/122792717

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

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

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

ICode9版权所有