List function index | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

List function index

The list function index() returns the index of a given value in the list, but if I have a list of below things=[1,2,'a','b',3.0,4.5, 1] Here I've value "1" twice in the list. When use print(things.index(1)) it returns "0". My question here is what about another index of the same value? and how to get the index of next occurrences?

25th Dec 2017, 8:29 PM
Chandrashekhar Rachakonda
Chandrashekhar Rachakonda - avatar
1 Respuesta
0
Thanks Brent, Yes programetically it can be done, as you said, but my question is to get the index of next occurance index by using list functions, if any. Is it possible?
26th Dec 2017, 7:38 AM
Chandrashekhar Rachakonda
Chandrashekhar Rachakonda - avatar