经过很长时间的试错才知道源于python2.X和python3.X的不同,
原理都是采用map函数,但是二者返回的信息不同
Python2.x,可以使用map函数
list=[] # 空列表
1
|
list
=
map
(
int
, list) 或者
|
如果是3.x,map返回的是map对象,当然也可以转换为List:
1
|
list
=
list
(
map
(
float
, list))
|
所以这里需要区别对待;