programming-examples/python/String/Python program to sort a string lexicographically.py

5 lines
162 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def lexicographi_sort(s):
return sorted(sorted(s), key=str.upper)
print(lexicographi_sort('w3resource'))
print(lexicographi_sort('quickbrown'))