Hi,<div><br></div><div>I'm trying to create a list (L) from items of different lists (a, b, c) but in a specific order (L = [[a1, b1, c1], [a2, b2, c2]...etc])</div><div><div>L = []</div><div>a = [1, 2, 3, 4]</div><div>
b = ['a', 'b', 'c', 'd']</div><div>c = [2009, 2010, 2011, 2012]</div><div><br></div><div>for x, y , z in zip(a, b, c):</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>L.extend([x, y, z])</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>print L</div></div><div> </div><div>But this outputs:</div><div><div>[[1, 'a', 2009]]</div><div>[[1, 'a', 2009], [2, 'b', 2010]]</div>
<div>[[1, 'a', 2009], [2, 'b', 2010], [3, 'c', 2011]]</div><div>[[1, 'a', 2009], [2, 'b', 2010], [3, 'c', 2011], [4, 'd', 2012]]</div></div><div><br></div><div>I just want L = [[1, 'a', 2009], [2, 'b', 2010], [3, 'c', 2011], [4, 'd', 2012]]</div>
<div><br></div><div>Saad</div>