本文摘自php中文网,作者coldplay.xixi,侵删。

用python画月亮的代码是什么?
用python画月亮的代码是
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | 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画月亮的代码是什么?的详细内容,更多文章请关注木庄网络博客!!
相关阅读 >>
Python怎么念
Python绝对值怎么计算
如何解决Python写入html文件中乱码的现象(图文详解)
Python函数之bool([x])用法详解
在vs code上搭建Python开发环境的方法_Python
Python提供了哪三种方法用于读取文本文件的内容?
Python语言基础都有哪些
基于Python的图片修复程序(实现水印去除)
Python读取文本数据并转化为dataframe格式的方法详解
Python怎么保存文件
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » 用python画月亮的代码是什么?