用Python编写程序

已知某个班有30个学生,学习5门课程,已知所有学生的各科成绩。请编写程序:分别计算每个学
生的平均成绩,并输出。
注意:定义一个二维数组A,用于存放30个学生的5门成绩。定义一个一维数组B,用于存
放每个学生的5门课程的平均成绩。
①使用二重循环,将每个学生的成绩输入到二维数组A中。
②使用二重循环,对已经存在于二维数组A中的值进行平均分计算,将结果保
存到一维数组B中。
③使用循环输出一维数组B(即平均分)的值。


all_score=[]
avg_score=[]
for i in range(30):
    list =[]
    for i in range(5):
        list.append(65) #增加的没门分数
    all_score.append(list)
print(all_score)

for i in all_score:
    d=0
    for s in i:
        d+=s
    avg_score.append(d/5)
print(avg_score)

for i in avg_score:
    print(i)