Shuffle list with empty (or None) elements [closed]
问题 Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Improve this question I've got some list of lists and it values can be empty [] or NoneType lst = [[[]], [1, None], 2, [[], 3], 4] And I need to randomise them. To get [[1, None], 4, 2, [[], 3], [[]]] , for example. But if I use shuffle(lst) I've got an exception: TypeError: