Re: more elements in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg32258] Re: more elements in a list
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 9 Jan 2002 23:37:12 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <a1gv6a$n6n$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
RepeatList[lst_List, rep_List] /; Length[lst] == Length[rep] :=
Sequence @@@ Table @@@ Transpose[{lst, {#} & /@ rep}]
will do that.
Regards
Jens
merkat wrote:
>
> 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