I have the following situation: - I have a variable called (distrow_vector). This variable receives a 2D list with multiple vectors. - I want it to be displayed, only vectors whose sum of their indexes are less than 100. - I have the code below, but it is not doing what I need.
def funcao_fitness():
fitness = 0
i = 0
vetor_distancias = [[10,20,30,40],[50,60,70,80],[5,6,7,8],[100,200,300,400],[9,15,25,30]]
for i in vetor_distancias:
fitness = (fitness + i) if i <= 100
print (fitness[i])
return fitness
print (funcao_fitness())
Thanks in advance for your help.