资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

如何用python代码画一个月亮-创新互联

Python简介

10年积累的成都网站设计、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有科尔沁免费网站建设让你可以放心的选择与我们合作。

Python是一种跨平台的计算机程序设计语言。 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的、大型项目的开发。

代码

import turtle as t
t.screensize(800,600,"#483d8b")#画布尺寸和颜色
t.up()#抬起笔
t.goto(-100,64)#把笔移到坐标的位置
t.pd()#放下笔
t.fillcolor('#ffd700')#填充色
t.begin_fill()#开始填充(一定要在画你想画的图案之前)
t.pencolor('#ffd700')#画笔颜色
t.pensize(3)#画笔尺寸
t.circle(18)#圆的半径
t.end_fill()#结束填充(在画完之后)
 
t.up()
t.goto(-110,60)
t.pd()
t.pencolor('#ff0000')
t.pensize(10)
t.fd(20)
t.up()
t.goto(-120,60)
t.pd()
t.pencolor('#ff0000')
t.pensize(10)
t.seth(-40)#画笔移动方向
for i in range(3):
t.circle(40, 80)
t.circle(-40, 80)
t.circle(40, 80/2)
t.up()
t.goto(-100,34)
t.pd()
t.pensize(55)
t.pencolor('#adff2f')
t.seth(-90)
t.fd(36)
t.seth(7)
t.pensize(8)
t.pencolor("yellow")
t.fillcolor('yellow')
t.speed(15)#速度
t.begin_fill()
t.circle(-800)
t.end_fill()
t.pencolor('#ffd700')
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(200,-300)
t.pd()
t.pensize(5)
t.circle(20)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(500,-300)
t.pd()
t.pensize(6)
t.circle(50)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-200,-300)
t.pd()
t.pensize(6)
t.circle(35)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-100,-200)
t.pd()
t.pensize(6)
t.circle(44)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-300,-200)
t.pd()
t.pensize(6)
t.circle(34)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-350,-350)
t.pd()
t.pensize(6)
t.circle(20)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-350,-350)
t.pd()
t.pensize(6)
t.circle(20)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(100,-350)
t.pd()
t.pensize(6)
t.circle(30)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(-500,-350)
t.pd()
t.pensize(6)
t.circle(50)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(200,-200)
t.pd()
t.pensize(6)
t.circle(60)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(360,-360)
t.pd()
t.pensize(6)
t.circle(70)
t.end_fill()
t.up()
t.fillcolor('#daa520')
t.begin_fill()
t.goto(50,-100)
t.pd()
t.pensize(6)
t.circle(50)
t.end_fill()

以上就是用python画月亮的代码,更多请关注创新互联其它相关文章!


分享文章:如何用python代码画一个月亮-创新互联
URL标题:http://cdkjz.cn/article/esosi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220