Skip to content

Instantly share code, notes, and snippets.

View mthomas's full-sized avatar

Michael Thomas mthomas

View GitHub Profile
#csharp
(new[]{1,2,3,4}).Where( i => i % 2 == 0 );
#ruby
[1,2,3,4].select{ |x| x.even? }
#python
[x for x in [1,2,3,4] if not x%2]
#or, more norvingly
filter(lambda x: not x%2, [1,2,3,4])