Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

7stud bbxx789_05ss at yahoo.com
Mon Apr 9 04:43:11 EDT 2007


On Apr 9, 2:29 am, "人言落日是天涯,望极天涯不见家" <kelvin.... at gmail.com> wrote:
> Is there a simple function to generate a list like ['a', 'b', 'c', ...
> 'z']?   The range() just can generate the numeric list.

Not very simple, but how about a list comprehension:

import string

lst = [char for char in string.letters[:26] ]
print lst


More information about the Python-list mailing list