python manipulations on lists
<p>I have 2 lists</p>

<pre><code>l1 = ('A','B','C')
l2 = ('X','Y','Z')
</code></pre>

<p>I want to create a list based on these 2 </p>

<p>result = ('A is same as X', 'B is same as Y', 'C is same as Z')</p>

<p>when I concatenate , I do not get the result I expect
How can I combine the lists ?
Thanks
PMV</p>

<p>the zip() function can help you here.</p>

<pre><code>result = []
for a, b in zip(l1, l2):
    result.append("{0} is same as {1}".format(a, b))
</code></pre>

python string list data-manipulation