I`m trying to append an list of the indexes of another list.
I have one list with random numbers, and need to create another list, with the indexes of the first list.
My code is just like this:
from random import seed
from random import randint
seed(715)
g1 = []
g2 = []
for v in range(20328):
valor = randint(40, 220)
g1.append(valor)
for v in enumerate(g1):
g2.append(v)
print("v g1[v] g2[v] g1[g2[v]]")
for v in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
print(v, g1[v], g2[v], g1[g2[v]])
But I get the error below:
print(v, g1[v], g2[v], g1[g2[v]])
TypeError: list indices must be integers or slices, not tuple
What am i doing wrong?