Answers for "sort the list into two halved with odd position n one list"

0

sort the list into two halved with odd position n one list

>>> a = ['blah', 3,'haha', 2, 'pointer', 1, 'poop', 'fire']
>>> a[0:][::2] # even
['blah', 'haha', 'pointer', 'poop']
>>> a[1:][::2] # odd
[3, 2, 1, 'fire']
Posted by: Guest on April-16-2021

Code answers related to "sort the list into two halved with odd position n one list"

Browse Popular Code Answers by Language