nick34992
2/12/2017 - 2:03 PM

Python For Loop Sequence of Alphabet

Python For Loop Sequence of Alphabet

#!/usr/bin/env python

def _treatment(position, letter):
    return '%d: %s' % (position, letter)

sequence = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", \
            "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
print([_treatment(index, ltr) for index, ltr in enumerate(sequence, \
                                                                start=1)])