Skip to content

Instantly share code, notes, and snippets.

@leigh-johnson
Created December 26, 2015 19:31
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 leigh-johnson/f2c1489d8c9f0b632969 to your computer and use it in GitHub Desktop.
Save leigh-johnson/f2c1489d8c9f0b632969 to your computer and use it in GitHub Desktop.
def returnOddIntsEvenIndex(a):
for i in range(a):
if x % 2 > 0:
# index is odd, test type, return if odd
if isinstance(a[i], int):
yield a[i]
else:
# index is even, return always
yield a[i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment