本文共 259 字,大约阅读时间需要 1 分钟。
错误:
TypeError:object of type ‘map’ has no len()python 3 中的map没有len功能了
解决方案:x = [[1, 'a'], [2, 'b'], [3, 'c']]len(map(lambda a: a[0], x))
len(list(map(lambda a: a[0], x)))
my_list = [a[0] for a in x]len(my_list)
转载地址:http://cabq.baihongyu.com/