i was wondering if there was any simple way around sorting tuples in lists in python, for instance if i have a list:
list01 = ([a,b,c],[b,a,d],[d,e,c],[a,f,d])
and i sorted it, i would get:
([a,b,c],[a,b,d],[c,d,e],[a,d,f])?
or even:
([a,b,c],[a,b,d],[a,d,f],[c,d,e])
if that's easier
Thanx in advance:)
解决方案>>> list01 = (['a','b','c'],['b','a','d'],['d','e','c'],['a','f','d'])
>>> map(sorted, list01)
[['a', 'b', 'c'], ['a', 'b', 'd'], ['c', 'd', 'e'], ['a', 'd', 'f']]
>>> sorted(map(sorted, list01))
[['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'd', 'f'], ['c', 'd', 'e']]