Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for get index and value

# get index and value in python for loop

your_list = ['apple', 'banana', 'orange']

for index, value in enumerate(your_list):
    print(index, value)

# will print the following:
#   0 apple
#   1 banana
#   2 orange
 
PREVIOUS NEXT
Tagged: #python #index
ADD COMMENT
Topic
Name
8+1 =