python遍历输出列表中最长的单词
具体代码:
word_len_list = [len(word) for word in list] max_word_len = max(word_len_list) for word in list: if len(word) == max_word_len: #print(word) list = []
推荐教程:python教程
以上就是python遍历输出列表中最长的单词的详细内容,更多请关注php中文网其它相关文章!
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
上一篇:python中元组和列表有什么区别 下一篇:怎么用python画小黄人