Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Combining two lists' topicStudent Support Forum > General > Archives > "Combining two lists"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Nasser M. Abbasi
02/29/12 4:35pm

Say I have two lists, {a,b,c,d,e} and {f,g,h,i,j}. Now i want to combine them to {{a,f},{b,g},{c,h},{d,i},{e,j}}
=========================

use Transpose like this:

lst1 = {a, b, c, d, e} ;
lst2 = {f, g, h, i, j};

Transpose[{lst1, lst2}]

{{a, f}, {b, g}, {c, h}, {d, i}, {e, j}}

--Nasser

URL: ,

Subject (listing for 'Combining two lists')
Author Date Posted
Combining two lists joe 02/28/12 9:51pm
Re: Combining two lists jf 02/29/12 12:23pm
Re: Combining two lists Bill Simpson 02/29/12 1:33pm
Re: Combining two lists Nasser M. Ab... 02/29/12 4:35pm
Re: Combining two lists Bill 02/29/12 6:45pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic