
8 Sep
2016
8 Sep
'16
11:40 p.m.
On Fri, Sep 9, 2016 at 9:36 AM, Xavier Combelle xavier.combelle@gmail.com wrote:
and eventually this one work in all case of iterable
def shuffled3(iterable): result = list(iterable) random.shuffle(result) return result
This is the one obvious way to do this. Not all iterables can logically be shuffled, so the most normal approach would be to turn it into a list, then shuffle. Which is exactly what this does.
ChrisA