分类: Python/Ruby
2011-10-11 17:45:10
# -*- coding=gb2312 -*-
#a = (
# (120,250,780,567,234,6789),
# (120,234,560,256,555,5674),
# (789,250,634,894,456,1200),
# (695,250,432,356,654,686)
# )
#b = sorted(a,cmp=lambda x,y:cmp(x[0],y[0]) or cmp(x[1],y[1]) or cmp(x[2],y[2]))
#print a
#print b
#myL=[
# ['a',3],
# ['b',1],
# ['c',2],
#
# ]
#
#myLa=sorted(myL,cmp=lambda x,y:cmp(x[1],y[1]) ) #第二位数据排序
#myLb=sorted(myL) #第二位数据排序
#print myL
#print myLa
#print myLb
#汉字排序
cL=[
['我的',2],
['远方',3],
['远啊',4],
['安徽',5],
]
cLa=sorted(cL)
print cL
print cLa