[1755 views]
This is one of the popular questions asked to freshers in their interview questions. If you are planning to give a Python Developer Interview for fresher, you must definitely know this. In the code, you are asked to take an input String from user and then sort all the characters in the String in ascending order.
For the input string "pointers", we convert the string into list of characters. So it becomes -
['p','o','i','n','t','e','r','s']
Then we simply use the sorted() function of python to arrange the characters in ascending order. So, after that it becomes -
['e','i','n','o','p','r','s','t']