# program to calculate average of class marks mark = [[10,10,10], [7,6,9], [0,0,5], [0,0,0], [2,2,2]] classTotal = 0 for s in range(5): stotal=0 for m in range(3): stotal = stotal + mark[s][m] if stotal>0: studentAverage = round(stotal/3,1) else: studentAverage = 0 print("Average mark for student ",s, "is ",studentAverage) classTotal = classTotal +stotal classAvg =classTotal/15 print("Class average = ",classAvg)