Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bearzk/3837569 to your computer and use it in GitHub Desktop.
Save bearzk/3837569 to your computer and use it in GitHub Desktop.
python odd and even position element in list
a = range(0,10) #[1..11]
odd = a[::2] #[1,3,5,7,9]
even = a[1::2] #[2,4,6,8,10]
a = range(0,10) #[1..11]
odd = a[::2] #[1,3,5,7,9]
even = a[1::2] #[2,4,6,8,10]
a = range(0,10) #[1..11]
odd = a[::2] #[1,3,5,7,9]
even = a[1::2] #[2,4,6,8,10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment