Need a strange sort method...
python.list at tim.thechases.com
Mon Oct 16 22:00:33 CEST 2006
>>> that's trivial to do with slicing, of course. what makes you think you
>>> need to do this by calling the "sort" method ?
>> You are of course correct.. There might be a way to do this with
>> and i % 3
> Slicing will work only with a sorted list.
But modulus arithmetic will only work with contiguous,
non-repeating numeric sequences...Funky things happen with
[1,2,3,4,4,5,6,7,8,9,10] # "4" appears twice
where the position and the numeric value no longer correlate via
a simple modulus.
More information about the Python-list