s = "Sorting1234"
print("".join(sorted(s, key=lambda x: (x.isdigit(), x.isdigit() and int(x) % 2 == 0, x.isupper(), x.islower(), x))))
sorted通过元祖进行比较
tuple(false,ture)
tuple(ture,false)
后者元祖大
s = "Sorting1234"
print("".join(sorted(s, key=lambda x: (x.isdigit(), x.isdigit() and int(x) % 2 == 0, x.isupper(), x.islower(), x))))
sorted通过元祖进行比较
tuple(false,ture)
tuple(ture,false)
后者元祖大