Python enumertate

Python enumertate function

Code Style of Python Guide

enumerate() can be used to keep track of the index of the list.

test = [None] * 5
for n, elem in enumerate( range(5,10) ):
    print n, elem
    test[n] = elem*2

Here we also used the technique of creating a list of length 5.

Planted: by ;

L Ma (2015). 'Python enumertate', Datumorphism, 12 April. Available at: https://datumorphism.leima.is/til/programming/python/python-enumerate/.