Looping through a sequence : Enumerate : Buildin Function PYTHON examples


PYTHON examples » Buildin Function » Enumerate »

 

Looping through a sequence


Looping through a sequence


# the position index and corresponding value can be retrieved at the same time using 
# the enumerate() function.

 
for i, v in enumerate(['tic', 'tac', 'toe']):
     print i, v



           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Buildin Function
» Enumerate