I know there is a sort function:
>>> a = 'bags'
>>> ''.join(sorted(a))
'abgs'
However, I need to write mine from scratch. I think I would like to use mergesort but I'm not sure how that would work for a string in Python. E.g., can I compare characters? Can I find the middle of a string somehow?
I'm using Python 3.4.
a_list = list(a)and go from there instead.sorted(), it'll return a list though.''.join(list_of_strings).