Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

what is index in list in python

butterfly_life_cycle = ["egg", "larva", "pupa", "butterfly"]

print(butterfly_life_cycle.index("egg"))
print(butterfly_life_cycle.index("larva"))
print(butterfly_life_cycle.index("pupa"))
print(butterfly_life_cycle.index("butterfly"))
# output:
# 0
# 1
# 2
# 3
 
PREVIOUS NEXT
Tagged: #index #list #python
ADD COMMENT
Topic
Name
6+5 =