Is there an easy way to sort the letters in a string alphabetically in Python?
So for:
a = 'ZENOVW'
I would like to return:
'ENOVWZ'
You can do:
>>> a = 'ZENOVW' >>> ''.join(sorted(a)) 'ENOVWZ'
2.1m questions
2.1m answers
60 comments
57.0k users