MathGroup Archive 2011

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

Search the Archive

Re: Pattern to match element in nested list


JasonE wrote:

> This is pretty basic and I am surprised at myself that I can't figure
> this out, but I guess its where I am at.
>
> What pattern would pick students with a score of zero out of this list
> (which is {"student", score}):
>
> {{"Smith, Tim",3},{"Wheres,Waldo",4},{"Muffet, LilMiss",0},{"Brown,
> Charlie",1},{"X, Doctor",0}}
>

Try (ll is your list):

Cases[ll,{__,0}]

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de



  • Prev by Date: Re: Keeping track of variables used in Mathematica
  • Next by Date: Re: dynamic nested loops
  • Previous by thread: Re: Pattern to match element in nested list
  • Next by thread: Re: Pattern to match element in nested list