using the enumerate() : enumerate « List « Python Tutorial






nameList = ['A', 'B', 'C', 'D','E', 'F', 'G']

for i, eachLee in enumerate(nameList):
     print "%d %s Lee" % (i+1, eachLee)
7.9.enumerate
7.9.1.using the enumerate()