On Sat, Aug 23, 2008 at 6:02 AM, ssecorp <[EMAIL PROTECTED]> 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,
On Fri, Aug 22, 2008 at 6:02 PM, ssecorp <[EMAIL PROTECTED]> wrote:
> .['a'..'z'] for a list of the alphabet.
>
> Is there a way in Python to generate chars?
Not as nice as in Haskell (or other languages), but:
[chr(i) for i in xrange(ord('a'), ord('z')+1)]
Regards
--
http://mail.python.org/mai
ssecorp 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:
def haskellrange(sc,ec):
if type(sc) is int:
for ii in range(sc,ec):
yield ii
else:
for ii in range(
On Fri, 22 Aug 2008 15:02:19 -0700 (PDT), ssecorp 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?
It's not actually about generating anything, but why should
one generate something if it's accessible
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?
--
http://mail.python.org/mailman/listinfo/python-list