programming-examples/python/String/Python program to sort a string lexicographically.py
2019-11-15 12:59:38 +01:00

5 lines
162 B
Python

def lexicographi_sort(s):
return sorted(sorted(s), key=str.upper)
print(lexicographi_sort('w3resource'))
print(lexicographi_sort('quickbrown'))