2019-02-26
閱讀量:
1002
python 中map函數(shù)報(bào)錯(cuò)
python 中map函數(shù)報(bào)錯(cuò):報(bào)錯(cuò)信息如下

答:這是參數(shù)傳錯(cuò)導(dǎo)致的,map函數(shù)的第二個(gè)參數(shù)需要是可迭代的,map函數(shù)的文檔做了如下介紹
Docstring:
map(function, sequence[, sequence, ...]) -> list
Return a list of the results of applying the function to the items of
the argument sequence(s). If more than one sequence is given, the
function is called with an argument list consisting of the corresponding
item of each sequence, substituting None for missing values when not all
sequences have the same length. If the function is None, return a list of
the items of the sequence (or a list of tuples if more than one sequence).
Type: builtin_function_or_method
其中function位置需要傳入函數(shù),后面的可以傳入一個(gè)或多個(gè)序列類型的參數(shù),如列表、字典、元組等






評(píng)論(0)


暫無數(shù)據(jù)
CDA考試動(dòng)態(tài)
CDA報(bào)考指南
推薦帖子
0條評(píng)論
0條評(píng)論
0條評(píng)論
0條評(píng)論