Ann
0
Q:

get index of list python

list.index(element)
13
test = [ 'test 1', 'test 2', 'test 3' ]
for index, value in enumerate( test ):
  print( index, value )
1
#Example List
list = ['apples', 'bannas', 'grapes']
#Use Known Entites In The List To Find The Index Of An Unknown Object
Index_Number_For_Bannas = list.index('apples')
#Print The Object
print(list[Index_Number_For_Bannas])
9
list.index(element, start, end)
3
[(i, colour.index(c))
 for i, colour in enumerate(colours)
 if c in colour]
0
list.index(element
0

New to Communities?

Join the community