Skip to content

Instantly share code, notes, and snippets.

@3rdAnimal
Last active July 9, 2018 22:51
Show Gist options
  • Save 3rdAnimal/df266722e0e7c1f61ce848b3234eeaa8 to your computer and use it in GitHub Desktop.
Save 3rdAnimal/df266722e0e7c1f61ce848b3234eeaa8 to your computer and use it in GitHub Desktop.
practicepython.org: List Comprehensions
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
b = [ num for num in a if num%2==0 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment