机器人
积分排行榜
Scratch
积分排行榜
Python
在线答题
积分排行榜
活跃排行榜
打字练习
Microbit
C++
在线答题
积分排行榜
活跃排行榜
网盘
积分
未登录
未登录
登录学习
作者:
张亦铭
更新时间:
2025-06-08 15:47
浏览:
33次
点赞:
0次
热度:
20
import turtle import random num = int(input("请输入一个整数,表示气球数量:")) num2 = int(input("请输入一个整数,表示气球大小:")) ''' a=input() print(a+a) b=int(a) print(b+b) ''' t = turtle.Pen() t.hideturtle() t.speed(0.1) color = ["red","yellow","blue","green","orange"] for i in range(num): a = random.randint(-200,200) b = random.randint(-200,200) t.penup() t.goto(a,b) t.begin_fill() t.pendown() t.color(color[i%5]) c = random.randint(1,3) if c == 1: t.circle(num2) elif c == 2: for i in range(3): t.forward(num2) t.left(120) elif c == 3: for i in range(5): t.forward(num2) t.left(144) t.end_fill()
点赞成功
分享作品
×