Source Code:
(back to article)
# Define a list of fruits fruits = ['apple', 'banana', 'mango', 'orange'] # Find the index of 'mango' in the list index = fruits.index('mango') # Print the index print(index)
Result:
Report an issue