0

I have 2 lists

X=

Y=

I need to make a new list Z such that,

Z =

I know this uses simple concatenation. I tried several times but without success. I am a beginner so please help me with the code. Thanks in advance.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Gribouillis
1
>>> Z = []
>>> X=['a']
>>> Y=['b','c','d','e','f']
>>> for i in Y:
...     Z.append(X[0] + i)
...     
>>> Z
['ab', 'ac', 'ad', 'ae', 'af']
>>>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.