Generate alphabet?

Leo Jay python.leojay at gmail.com
Sat Aug 23 10:33:02 EDT 2008


On Sat, Aug 23, 2008 at 6:02 AM, ssecorp <circularfunc at gmail.com> wrote:
> In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list
> of the alphabet.
>
> Is there a way in Python to generate chars?
>

how about:
>>> import string
>>> ','.join(string.ascii_lowercase)
'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'
>>>


-- 
Best Regards,
Leo Jay



More information about the Python-list mailing list