赞
踩
import turtle as t import random t.pensize(1) t.screensize(800,800,'black') def stars(x,y,left_angle,edge_len): t.pencolor('yellow') t.fillcolor('yellow') t.penup() t.goto(x,y) t.begin_fill() t.pendown() t.left(left_angle) for _ in range(5): t.forward(edge_len) t.right(144) t.end_fill() for _ in range(300): x=random.randint(-450,450) y=random.randint(0,400) edge_len=random.randint(3,8) left_angle=random.randint(0,180) stars(x,y,left_angle,edge_len)
好了,今天的分享就到这里!如果你对Python感兴趣,想要学习pyhton,这里给大家分享一份Python全套学习资料,里面的内容都是适合零基础小白的笔记和资料,超多实战案例,不懂编程也能听懂、看懂。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。