im trying to create a ranking system to order the fruits in the order of biggest to smallest:
is_big = [None,None,10,1/100,-1/100]
i need to add the values of is_big[i] corresponding with the indexes of fruits object
fruits = [['Pear','green',2,3,5],
['Apple','red',5,2,10],
['mango','yellow',4,6,12]]
to make the ranking system im giving a score based on the fruits element values and the values of is_big i need to multiply is_big[i] with fruits[i] and sum it up ,where is_big != None the expected results should be fruits_ranking =[[19.98],[49.92],[39.94]] so that after sorting fruits_ranking i get the results
fruits =[['Apple','red',5,2,10],
['mango','yellow',4,6,12],
['Pear','green',2,3,5]]
my code so far is:
rs = []
for i in range(len(fruits)):
for c in range(len(is_big)):
if battery[c]!= None and not isinstance(is_big[i],str):
rs.append(is_big[i]*fruits[c])
as you can see my code does not work any kind of help would be appreciated
phones?