设计知识点:使用turtle绘图库与random库产生一个范围随机数完成绘制。
编译环境:anaconda-spyder
比较通俗,就不搞注释了,懒得写,废话不多说,直接上代码:
#绘制星空
import turtle as t,random as r
("black")
(20)
("white")
("white")
for i in range((50,70)):
()
((-400,400),(-400,400))
()
t.begin_fill()
D=(2,12)
for i in range(5):
(D)
(144)
t.end_fill()
()
()