Q:

Write a Python program to sort a string lexicographically.

0

Write a Python program to sort a string lexicographically. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def lexicographi_sort(s):
    return sorted(sorted(s), key=str.upper)

print(lexicographi_sort('w3resource'))
print(lexicographi_sort('quickbrown'))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now