Answers for "list index of value python"

0

how to get index of item in list python

animals = ['cat', 'dog', 'rabbit', 'horse']

# get the index of 'dog'
index = animals.index('dog')


print(index)

# Output: 1
Posted by: Guest on August-09-2021

Code answers related to "list index of value python"

Python Answers by Framework

Browse Popular Code Answers by Language