filerecords = [['File{0}Record{1}'.format(i, j) for j in range(5)] for i in
    range(5)]
concatenation = []
while any(filerecords):
    selection = random.choice(filerecords)
if selection:
    concatenation.append(selection.pop())
else:
    filerecords.remove(selection)
concatenation
Shuffle the records of a list of text files in one single file