a = [['3D'], ['3D', '4D', '5D'], ['4C'], ['4C', '4D'], ['4D'], ['5D'], ['JC'], ['JC', 'JS'], ['JS']]
confrom = {'3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, '0':10, 'J':11, 'Q':12, 'K':13, 'A':14, '2':15}
print sorted(a, key = lambda x: (len(x), [confrom[card[0]] for card in x]))
YSA9IFtbJzNEJ10sIFsnM0QnLCAnNEQnLCAnNUQnXSwgWyc0QyddLCBbJzRDJywgJzREJ10sIFsnNEQnXSwgWyc1RCddLCBbJ0pDJ10sIFsnSkMnLCAnSlMnXSwgWydKUyddXQpjb25mcm9tID0geyczJzozLCAnNCc6NCwgJzUnOjUsICc2Jzo2LCAnNyc6NywgJzgnOjgsICc5Jzo5LCAnMCc6MTAsICdKJzoxMSwgJ1EnOjEyLCAnSyc6MTMsICdBJzoxNCwgJzInOjE1fQpwcmludCBzb3J0ZWQoYSwga2V5ID0gbGFtYmRhIHg6IChsZW4oeCksIFtjb25mcm9tW2NhcmRbMF1dIGZvciBjYXJkIGluIHhdKSk=
[['3D'], ['4C'], ['4D'], ['5D'], ['JC'], ['JS'], ['4C', '4D'], ['JC', 'JS'], ['3D', '4D', '5D']]