Yields a copy of the given list with the items in random order.
(list)
| 100 | #--- LIST FUNCTIONS -------------------------------------------------------------------------------- |
| 101 | |
| 102 | def shuffled(list): |
| 103 | """ Yields a copy of the given list with the items in random order. |
| 104 | """ |
| 105 | return sorted(list, key=lambda x: random()) |
| 106 | |
| 107 | def chunk(list, n): |
| 108 | """ Yields n successive equal-sized chunks from the given list. |
no test coverage detected
searching dependent graphs…