views:

136

answers:

5

1. Print a-n: a b c d e f g h i j k l m n

2. Every second in a-n: a c e g i k m

3. Append a-n to index of urls{hello.com/, hej.com/, ..., hallo.com/}: hello.com/a hej.com/b ... hallo.com/n

+4  A: 
>>> import string
>>> string.lowercase[:14]
'abcdefghijklmn'
>>> string.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.lowercase[:14])]
gnibbler
+2  A: 

Hints:

import string
print string.ascii_lowercase

and

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

and

"hello{0}, world!".format('z')
Wayne Werner
+1  A: 
for one in range(97,110):
    print chr(one)
yedpodtrzitko
A: 

This is your 2nd question: string.lowercase[ord('a')-97:ord('n')-97:2] because 97==ord('a') -- if you want to learn a bit you should figure out the rest yourself ;-)

THC4k
A: 

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()

Nas Banov