Possible Duplicate:
Shuffling a list of objects in python
IF I have a list:
a = ["a", "b", "c", ..., "zzz"]
how can I randomly shuffle its elements in order to obtain a list:
b = ["c", "zh", ...]
without consuming a lot of the system's resources?
import random
b = list(a)
random.shuffle(b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With