如何用python代码画一个月亮

Python简介

创新互联专注于柏乡网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供柏乡营销型网站建设,柏乡网站制作、柏乡网页设计、柏乡网站官网定制、重庆小程序开发服务,打造柏乡网络公司原创品牌,更为您提供柏乡网站排名全网营销落地服务。

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://bzwzjz.com/article/ghogdd.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站制作 成都企业网站制作 宜宾网站设计 重庆网站建设 成都定制网站建设 重庆电商网站建设 教育网站设计方案 盐亭网站设计 成都企业网站设计 手机网站建设套餐 手机网站制作设计 做网站设计 营销网站建设 成都响应式网站建设 成都网站设计 成都营销网站建设 成都网站建设 高端定制网站设计 成都网站建设 网站制作 网站制作公司 成都网站制作