Answers for "python sort lexicographically"

2

lexicographic order python

my_arr = [
"hello",
"apple",
"actor",
"people",
"dog"
]

print(my_arr)
my_arr.sort()
print(my_arr)
Posted by: Guest on July-01-2020
0

sort lexo python

#code
def sortlexo(n):
    w = []
    for i in n:
        w.append(i)
    
    w.sort
    w = w[::-1]
    for i in w:
        print(i,end = "")
for i in range(int(input())):
    n= input()
    sortlexo(n)
Posted by: Guest on May-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language