0 votes
1 view
in Python by (12.7k points)

How to print letters from a-n:

a b c d e f g h i j k l m n 

How to print every second element in a-n:

a c e g i k m

Then, Is there any way to append a-n to the index of URL's {hello.com/, hej.com/, ..., hallo.com/}:

hello.com/a hej.com/b ... hallo.com/n

1 Answer

0 votes
by (26.4k points)

Try:

>>> import string

>>> string.ascii_lowercase[:14]

'abcdefghijklmn'

>>> string.ascii_lowercase[:14:2]

'acegikm'

You can also do like this, for url's

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

Are you Interested to learn python ? Join our python course
For more details, do check out..

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 16, 2019 in Python by leealex956 (7.3k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...