+ 3
Hey whats the function of the index here?
4 RĂ©ponses
+ 4
The index function returns the position of a certain item inside a list.
Example:
ââââââââââââ
# Create a list
list = ['a','b','c','d']
# Find a certain item in the list, in this case, the letter b
print(list.index('b'))
# Output
>>>1
# Info: 1 is returned because python counts list items from 0, not 1
ââââââââââââ
Hope this helps đ
+ 3
Thx so much man. I really appreciate itâ
+ 3
Glad to be of help đ
+ 3
đđ€