发布于 1年前
Python 列表中最长的字符串
words = ['This', 'is', 'a', 'list', 'of', 'words']
result = max(words, key=len)
print(result)
# 'words'
words = ['This', 'is', 'a', 'list', 'of', 'words']
result = max(words, key=len)
print(result)
# 'words'