Skip to content

Instantly share code, notes, and snippets.

@scarecrow1123
Created April 15, 2016 10:08
Show Gist options
  • Save scarecrow1123/49914eb0ae984b8cd201daf71f7fc2a2 to your computer and use it in GitHub Desktop.
Save scarecrow1123/49914eb0ae984b8cd201daf71f7fc2a2 to your computer and use it in GitHub Desktop.
"""takes a list x and returns a list with odd integers or elements with even index"""
[i for idx,i in enumerate(x) if (type(i) is int) and (i%2 !=0 or idx%2==0)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment