Hypnos has already answered a very correct solution, so I’m just giving you a better way to understand what happened and how to identify such things in the future:
import random keys = ['1', '2', '3', '4', '5'] a = [] for x in range(10): random.shuffle(keys) a.append(keys) print a
gives:
[['4', '5', '3', '2', '1']] [['2', '5', '1', '4', '3'], ['2', '5', '1', '4', '3']] [['2', '5', '4', '1', '3'], ['2', '5', '4', '1', '3'], ['2', '5', '4', '1', '3']] [['5', '4', '3', '1', '2'], ['5', '4', '3', '1', '2'], ['5', '4', '3', '1', '2'], ['5', '4', '3', '1', '2']] [['1', '4', '3', '2', '5'], ['1', '4', '3', '2', '5'], ['1', '4', '3', '2', '5'], ['1', '4', '3', '2', '5'], ['1', '4', '3', '2', '5']] [['2', '3', '4', '1', '5'], ['2', '3', '4', '1', '5'], ['2', '3', '4', '1', '5'], ['2', '3', '4', '1', '5'], ['2', '3', '4', '1', '5'], ['2', '3', '4', '1', '5']] [['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3'], ['2', '1', '4', '5', '3']] [['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1'], ['2', '5', '3', '4', '1']] [['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1'], ['3', '5', '2', '4', '1']] [['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1'], ['4', '2', '3', '5', '1']]
Also, by noting that random.shuffle nothing, you may start to suspect that the conversion was done in place.