Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

enumerate

array = ["one","two","three","four"]
arrayOfNumbers = []
mainArray = []

for i, x in enumerate(array):
	arrayOfNumbers.append(i)
    mainArray.append(x)
    
'''
>>print(arrayOfNumbers)
>>[0, 1, 2, 3]


>>print(mainArray)
>>["one","two","three","four"]

'''
 
PREVIOUS NEXT
Tagged: #enumerate
ADD COMMENT
Topic
Name
8+3 =