Sorting elements in string with Python
- by prosseek
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?