Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: more elements in a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32297] Re: more elements in a list
  • From: "Dana" <ng_only at hotmail.com>
  • Date: Fri, 11 Jan 2002 04:35:37 -0500 (EST)
  • References: <a1gv6a$n6n$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I am rather new at this, so I will give it a try also.

l1={a,b,c};

l2={2,5,4};

l1*l2/.x_ y_:>Table[y,{x}]//Flatten

Out[3]=
{a,a,b,b,b,b,b,c,c,c,c}

--
Dana DeLouis


"merkat" <cabanc at hotmail.com> wrote in message
news:a1gv6a$n6n$1 at smc.vnet.net...
> Hi ,
>
> How do I multiply the number of elements in a list?
> I have the lists:
> {a,b,c}  and
> {2,5,4}
>
> the result should be:
> {a,a,b,b,b,b,b,c,c,c,c}
>
> Merkat
>




  • Prev by Date: distance Frame <-> labels?
  • Next by Date: Re: How to keep cells closed?
  • Previous by thread: Re: more elements in a list
  • Next by thread: Re: Re: more elements in a list