企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` import turtle import random turtle.pencolor("red") turtle.fillcolor("green") for i in range(30): turtle.penup() #turtle.goto(10,10) #turtle.goto(random.random()*100*i,random.random()*100*i) turtle.goto(random.randint(-300,300),random.randint(-300,300)) turtle.pendown() s = random.randint(2,8) turtle.begin_fill() turtle.circle(30,steps=s) turtle.end_fill() turtle.done() ``` ``` a = ['red','green'] import random b = random.choice(a) print(b) ``` ``` import turtle import random a = ['red','green'] turtle.pencolor(random.choice(a)) turtle.fillcolor(random.choice(a)) b = random.choice(a) print(b) for i in range(30): turtle.pencolor(random.choice(a)) turtle.fillcolor(random.choice(a)) b = random.choice(a) print(b) turtle.penup() #turtle.goto(10,10) #turtle.goto(random.random()*100*i,random.random()*100*i) turtle.goto(random.randint(-300,300),random.randint(-300,300)) turtle.pendown() s = random.randint(2,8) turtle.begin_fill() turtle.circle(30,steps=s) turtle.end_fill() turtle.done() ``` ``` import turtle import random a = ['red','green'] turtle.pencolor(random.choice(a)) turtle.fillcolor(random.choice(a)) b = random.choice(a) print(b) for i in range(30): r = b = g= random.randint(0,255) print(r) print(b) print(g) #g = random.randint(0,255) #b = random.randint(0,255) turtle.pencolor(r/255,g/255,b/255) turtle.fillcolor(r/255,g/255,b/255) #turtle.pencolor(random.choice(a)) #turtle.fillcolor(random.choice(a)) b = random.choice(a) print(b) turtle.penup() #turtle.goto(10,10) #turtle.goto(random.random()*100*i,random.random()*100*i) turtle.goto(random.randint(-300,300),random.randint(-300,300)) turtle.pendown() s = random.randint(2,8) turtle.begin_fill() turtle.circle(30,steps=s) turtle.end_fill() turtle.done() ``` ``` import random #r = b = g= random.randint(0,255) r =random.randint(0,255) b= random.randint(0,255) g= random.randint(0,255) print(r) print(b) print(g) ``` ``` #生成一个包含10个0~100之间随机整数的列表 import random line = [] from time import * now = strftime("%A,%d.%D %Y %I:%M%p",localtime()) print(now) now1 = strftime("%Y-%m-%d %H:%M:%S", localtime()) print(now1) #ll998 for i in range(10): line.append(random.randint(0,100)) print(line) ``` ``` from time import * now = strftime("%A,%d.%D %Y %I:%M%p",localtime()) print(now) now1 = strftime("%Y-%m-%d %H:%M:%S", localtime()) print(now1) ``` ``` import turtle import random turtle.pencolor("red") for i in range(30): turtle.penup() #turtle.goto(10,10) #turtle.goto(random.random()*100*i,random.random()*100*i) turtle.goto(random.randint(-300,300),random.randint(-300,300)) turtle.pendown() s = random.randint(2,8) turtle.circle(30,steps=s) turtle.done() ```