How to randomly partition a list into n nearly equal parts?

Solution 1:

Call random.shuffle() on the list before partitioning it.

Solution 2:

Complete 2018 solution (python 3.6):

import random 
def partition (list_in, n):
    random.shuffle(list_in)
    return [list_in[i::n] for i in range(n)]

Beware! this may mutate your original list