In python how to Find the index of an item in a list

Here we are going to elaborate In python how to Find the index of an item in a list,Suppose i have a list [“Red”, “blue”, “green”, “orange”] , How to find out  in the color list what is the position or key of “green”


 
           array1 = ["Red", "blue", "green", "orange"]

           print array1.index("green")      
           
           Output 
              
               2   


My Thought

Your email address will not be published. Required fields are marked *

Our Tool : hike percentage calculator