MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List operation

  • To: mathgroup at
  • Subject: [mg45630] Re: List operation
  • From: Mariusz Jankowski<mjankowski at>
  • Date: Fri, 16 Jan 2004 19:57:08 -0500 (EST)
  • Organization: University of Southern Maine
  • References: <bu8j16$au9$>
  • Sender: owner-wri-mathgroup at

Use Thread[{x,y}]


>>> Dr. Wolfgang Hintze<weh at> 1/16/2004 6:47:50 AM >>>
Given two lists

x = {a, b, c}
y = {A, B, C}

I'm looking for the list of pairs

z = {{a, A}, {b, B}, {c, C}}

Defining the function

paarweise[x_, y_, n_] := Table[{x[[i]], y[[i]]}, {i, 1, n}]


z = paarweise[x, y, 3]

{{a, A}, {b, B}, {c, C}}

I'm sure there is a more elegant way to get such a list of pairs.
Any help is appreciated.

Wolfgang Hintze

  • Prev by Date: RE: List operation
  • Next by Date: Re: List operation
  • Previous by thread: RE: List operation
  • Next by thread: Re: List operation