MathGroup Archive 2007

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

Search the Archive

Re: making mutliple list in one line

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78610] Re: making mutliple list in one line
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Thu, 5 Jul 2007 04:07:06 -0400 (EDT)

On 7/4/07 at 5:39 AM, JGBoone at gmail.com wrote:

>is there a way to make mutliple lists on one line of command? i am
>writing 3 lines like so

>a=Range[x]
>b=Range[x]
>c=Range[x]

>and want to make it into one line

There are a number of ways. First, in your example a, b, c all
get assigned the same value. So,

a=b=c=Range[x]

will work.

if a, b and c where not to be assigned the same value either

{a,b,c}={Range[x],Range[y],Range[z]}

or

a=Range[x];b=Range[y];c=Range[z];

would work.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: making mutliple list in one line
  • Next by Date: Re: making mutliple list in one line
  • Previous by thread: Re: making mutliple list in one line
  • Next by thread: Re: making mutliple list in one line