Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Created February 7, 2019 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdbartsch/f70559266cb6c87b170142166a631eb0 to your computer and use it in GitHub Desktop.
Save pdbartsch/f70559266cb6c87b170142166a631eb0 to your computer and use it in GitHub Desktop.
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
even = [n for n in a if n%2 == 0]
odd = [n for n in a if n%2 != 0]
print('even:', even, '\nodd:', odd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment