Sunday 25 December 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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...