[Python] 纯文本查看 复制代码 import turtle
import random
turtle.speed(0)
def rectangle(width,hight):
turtle.pendown()
color = ['red', 'yellow', 'blue', 'white', 'white', 'white', 'white']
turtle.fillcolor(random.choice(color))
turtle.begin_fill()
for i in range(2):
turtle.forward(width)
turtle.left(90)
turtle.forward(hight)
turtle.left(90)
turtle.end_fill()
turtle.penup()
width_list=[]
hight_list=[]
for i in range(5):
width_list.append(random.randint(100,120))
hight_list.append(random.randint(60,90))
print(width_list)
print(hight_list)
|