How do I find the longest word in a list

前端 未结 0 1901
囚心锁ツ
囚心锁ツ 2021-01-28 02:35

I tried this:

sentence = input("Sentence without punctuation: ")


lst = [sentence]
longestString = max(lst, key=len)
print(longestStri         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题