import functools sorted_ignore_case = functools.partial(sorted,cmp=lambda s1, s2: cmp(s1.upper(), s2.upper()),key=str.lower) print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])
2024-02-11 12:57:04
import functools sorted_ignore_case = functools.partial(sorted,cmp=lambda s1, s2: cmp(s1.upper(), s2.upper()),key=str.lower) print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])