Answer to Question #264592 in Python for swsq

Question #264592
  1. Find the words which are repeated more than 1time and sort them in lexicographic order if not found print NA
1
Expert's answer
2021-11-16T05:21:25-0500
def sortLexo(my_words):
    # Split the my_words till where space is found.
    words = my_words.split()

    # sort() is used to sort strings
    words.sort()

    for i in words:
        print(i)

if __name__ == '__main__':
    # in order to sort your words you need to enter your words below
    my_words = "Enter your words here "

    sortLexo(my_words)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS