用python画月亮的代码是什么?

coldplay.xixi
发布: 2020-06-17 14:25:23
原创
11868人浏览过

用python画月亮的代码是什么?

python画月亮的代码是什么?

用python画月亮的代码是

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画月亮的代码是什么?的详细内容,更多请关注php中文网其它相关文章!

python速学教程(入门到精通)
python速学教程(入门到精通)

python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
相关标签:
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号