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
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
>>> 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])]
Hints:
import string
print string.ascii_lowercase
and
for i in xrange(0, 10, 2):
print i
and
"hello{0}, world!".format('z')
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 ;-)
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()