-1
For example I have a list
[6,4,3,9,1]
the answer to that would be the index of the highest value of this list in example order to the top list
[1,3,2,0,4]
these are the indices of where their indices are, I’ve done so far:
def Cria_listas(tl,tv):
valor = []
if tv >= 1:
for i in range(tl):
valor = valor + [random.randint(0,tv]
print(valor)
return Fromint(valor)
def Fromint(n):
indice = []
for i in range(len(n)):
indice = [n.index(max(n))] + indice
Cria_listas(5,99)
I can find the intel of the highest value, but how do I find the next
Not understood, want to return a new list with the indexes of the ordered elements?
– Tuxpilgrim
Instead of
[1,3,2,0,4]
shouldn’t be[1,2,3,0,4]
?– AlexCiuffa