I need to sort string, and I came up with the following function.
def mysort(comb_): str = [] size = len(comb_) for c in comb_: str.append(c) str.sort() return ''.join(str)
Is there any way to make it compact?
return ''.join(sorted(comb_))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With