参考Python文档,可以使用max函数,设置其中的key 参数为len:
list1 = ['abc','abcde','a'] print(max(list1, key = len))
致谢: Python选择列表中最长字符串的最有效方法?