Answer to Question #265982 in Python for sai krishna

Question #265982

in the example the given list of strings are raju ,plays,golf

the word plays has the maximum number of distinct letters so the output should be plays

sample input 1

raju plays golf

sample out put 1

plays

sample inpput 2

Drink four liters of water every day

sample output 2

liters


1
Expert's answer
2021-11-14T10:43:10-0500
lst = input().split()
llst = [len(set(x)) for x in lst]
print(lst[llst.index(max(llst))])

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