Re: Pattern to match element in nested list
- To: mathgroup at smc.vnet.net
- Subject: [mg122833] Re: Pattern to match element in nested list
- From: Ray Koopman <koopman at sfu.ca>
- Date: Fri, 11 Nov 2011 07:33:05 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j9irl5$8ee$1@smc.vnet.net>
On Nov 11, 1:59 am, JasonE <ebaughja... at gmail.com> 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}}
>
> Thanks,
> Jason
>
> Contact: jasoneba... at jasonebaugh.info
> Blog:www.jasonebaugh.info/wordpress/
> LinkedIn:www.linkedin.com/in/jasonebaugh
Cases[{{"Smith, Tim",3},{"Wheres,Waldo",4},{"Muffet, LilMiss",0},
{"Brown, Charlie",1},{"X, Doctor",0}}, {_,0}]
{{Muffet, LilMiss,0},{X, Doctor,0}}