>>> import random
>>> items = []
>>> for i in range(13):
for j in ['A','B','C','D']:
items.append( (j+str(i)) )
>>> items
['A0', 'B0', 'C0', 'D0', 'A1', 'B1', 'C1', 'D1', 'A2', 'B2', 'C2', 'D2', 'A3', 'B3', 'C3', 'D3', 'A4', 'B4', 'C4', 'D4', 'A5', 'B5', 'C5', 'D5', 'A6', 'B6', 'C6', 'D6', 'A7', 'B7', 'C7', 'D7', 'A8', 'B8', 'C8', 'D8', 'A9', 'B9', 'C9', 'D9', 'A10', 'B10', 'C10', 'D10', 'A11', 'B11', 'C11', 'D11', 'A12', 'B12', 'C12', 'D12']
>>> random.shuffle(items)#打乱顺序
>>> items
['C11', 'B8', 'D12', 'B6', 'A11', 'A2', 'D4', 'C12', 'C9', 'A1', 'B10', 'A6', 'B7', 'D1', 'D11', 'C3', 'B4', 'C2', 'B3', 'A5', 'A10', 'D6', 'D0', 'B12', 'B2', 'D8', 'D5', 'A4', 'D10', 'D2', 'B11', 'B5', 'D7', 'B1', 'C8', 'D9', 'B0', 'A9', 'C5', 'C1', 'C0', 'A0', 'D3', 'C6', 'C4', 'C10', 'A8', 'A3', 'A12', 'C7', 'B9', 'A7']
>>> for a in range(13):
ab = []
for b in range(4):
ab.append( items[a+b*13] )
print (ab,(a+1))
['C11', 'D1', 'D5', 'C1'] 1
['B8', 'D11', 'A4', 'C0'] 2
['D12', 'C3', 'D10', 'A0'] 3
['B6', 'B4', 'D2', 'D3'] 4
['A11', 'C2', 'B11', 'C6'] 5
['A2', 'B3', 'B5', 'C4'] 6
['D4', 'A5', 'D7', 'C10'] 7
['C12', 'A10', 'B1', 'A8'] 8
['C9', 'D6', 'C8', 'A3'] 9
['A1', 'D0', 'D9', 'A12'] 10
['B10', 'B12', 'B0', 'C7'] 11
['A6', 'B2', 'A9', 'B9'] 12
['B7', 'D8', 'C5', 'A7'] 13
>>>