Run
string = 'apple' sorted_chars = sorted(string) sorted_string = ''.join(sorted_chars) print(sorted_string)
Output