我想在python上做一个练习(我的版本是python33练习如下:
编写一个函数find_longest_word1(),它接受一个单词列表并返回最长单词的长度.仅使用更高阶的功能.
我的尝试是:
def find_longest_word1(a):
out = max(list(map(len,a)))
print (out)
find_longest_word1(["This","is","a","listing"])
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
max() missing 1 required positional argument 'b'
Run Code Online (Sandbox Code Playgroud)
我已经传递了一个列表作为参数.我是否需要为max函数提供其他参数?