Sunday, December 25, 2016

python - Find what index an element is in a list

In Python if you have a list:



list = [ cow , dog , cat ]


Is it possible to find what index an element is at?



Is there a command which does something like:




{some code}(cow)


and have it say something like
cow = 0?

No comments:

Post a Comment