Feb-28-2017, 10:30 PM
(Feb-28-2017, 09:54 PM)Ofnuts Wrote: Warning: using a comprehension for the side effects should only be attempted by trained professionals.
numbers = [12, 37, 5, 42, 8, 3] even,odd=[],[] _=[[even,odd][i%2].append(i) for i in numbers]
I am totally lost here.
![Big Grin Big Grin](https://python-forum.io/images/smilies/biggrin.png)
![Huh Huh](https://python-forum.io/images/smilies/huh.png)
@buran, thank you for this. I was thinking that list.next() is next element from the list but it is next index. And it's reindexing all when I change the list.