Shuffle an array with python, randomize array item order with python


Question

What's the easiest way to shuffle an array with python?

1
232
8/28/2017 5:58:35 PM

Accepted Answer

import random
random.shuffle(array)
428
1/23/2009 6:37:27 PM

import random
random.shuffle(array)

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon