Python: how to print range a-z? Python: how to print range a-z? python python

Python: how to print range a-z?


>>> import string>>> string.ascii_lowercase[:14]'abcdefghijklmn'>>> string.ascii_lowercase[:14:2]'acegikm'

To do the urls, you could use something like this

[i + j for i, j in zip(list_of_urls, string.ascii_lowercase[:14])]


Assuming this is a homework ;-) - no need to summon libraries etc - it probably expect you to use range() with chr/ord, like so:

for i in range(ord('a'), ord('n')+1):    print chr(i),

For the rest, just play a bit more with the range()


Hints:

import stringprint string.ascii_lowercase

and

for i in xrange(0, 10, 2):    print i

and

"hello{0}, world!".format('z')