MathGroup Archive 2009

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

Search the Archive

Re: Do-command


Do merely evaluates its expression it does not produce any output separate from what the expression does. Or as the help for Do states: Unless an explicit Return is used, the value returned by Do is Null.  Use Table

Table[Select[{1, 2, 4, 7, 6, 2}, # >= i &], {i, 7}]

{{1,2,4,7,6,2},{2,4,7,6,2},{4,7,6},{4,7,6},{7,6},{7,6},{7}}


Bob Hanlon

---- Uwe Gotzes <u.gotzes at googlemail.com> wrote: 

=============
Hi!

Can anybody tell, why
Do[Select[{1, 2, 4, 7, 6, 2}, # >= i &], {i, 7}]
does not produce output in Mathematica?




  • Prev by Date: Re: Do-command
  • Next by Date: Re: Generating a list numnber in string format
  • Previous by thread: Re: Do-command
  • Next by thread: Functions of Arrays