import random#导入随机数包
a = []#没有啥子用的列表
zxs=1000#必须大于6行随机数的最大数
sd=0#和起来的初始数
for i in range(10):#要判断多少个数字
a.append(random.randint(1,1000))#判断中最大最小数字
shu=a[i]#他是接下来列表中的数字
if shu<zxs:#一个判断shu是否小于最小数
zxs=shu#将最小数设为shu
sd+=shu#加起来
print("最小数是{0}".format(zxs))#没有什么用
print("合是{0}".format(sd))#没有什么用
print(a)#没有什么用
用for循环找最小数
最新推荐文章于 2024-01-25 13:55:51 发布