I need a program that takes a list of lists and drops the lowest score out of the list and prints the average scores.
For example if given: [[100,0,100] , [50,50,0] , [0,0,0]]
it should print:
Average for row 0 is 100.0
Average for row 1 is 50.0
Average for row 2 is 0.0
So far I have this but it doesn't allow me to enter a list of lists and it doesn't print to the corresponding rows.
def Averages (listofscores):
numofrows = 0
for number in listofscores:
scores = (sum (listofscores) - min (listofscores)) / ((len (listofscores)) - 1)
rows = listofscores [0]
if rows >=0:
print ('Average for row', numofrows, 'is', scores)
numofrows = numofrows + 1
else:
return None