Skip to content

Instantly share code, notes, and snippets.

@StrikingLoo
Created August 19, 2018 16:33
Show Gist options
  • Select an option

  • Save StrikingLoo/74fda7ea7fa01ea508161b306d2dffa3 to your computer and use it in GitHub Desktop.

Select an option

Save StrikingLoo/74fda7ea7fa01ea508161b306d2dffa3 to your computer and use it in GitHub Desktop.
some_list = [1,2,3,4,5,6,7,8,9]
only_even = [n for n in some_list if n%2==0]
def even(n):
return n%2 == 0
only_even_prettier = [n for n in some_list if even(n) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment