这样为啥不对呢
import functools
sorted_ignore_case = functools.partial(sorted,cmp=lambda x1,x2:cmp(x1[0].lower(),x2[0].lower() )
print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])
import functools
sorted_ignore_case = functools.partial(sorted,cmp=lambda x1,x2:cmp(x1[0].lower(),x2[0].lower() )
print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])
2020-03-15
举报