用turtle库画四朵随机的雪花
作者:互联网
import turtle as t import random as r r.seed(1) t.pensize(2) t.color('red') angles = 6 points= [[0,0],[50,40],[70,80],[-40,30]] for i in range(4): x0,y0 = points[i] t.penup() t.goto(x0,y0) t.pendown() length = r.randint(6, 16) for j in range(angles): t.fd(length) t.bk(length) t.right(360 / angles) t.done()
用turtle画四朵随机的雪花
效果:
标签:turtle,库画,四朵,40,length,angles,y0 来源: https://www.cnblogs.com/Allen8/p/15895127.html