String 在python中将列表中的字符串元素转换为整数

String 在python中将列表中的字符串元素转换为整数,string,list,int,String,List,Int,我有一个名为newlist的列表 newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']] 我需要将每个列表元素转换为整数 newlist=[[24,4,17,46,0,43], [11,43,17], [33,17,43,4], [74,21], [21,43,43,74,68,21]]. 有人能帮我吗。Python 3: newlist=[['24,4,17,4

我有一个名为newlist的列表

newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']]
我需要将每个列表元素转换为整数

newlist=[[24,4,17,46,0,43], [11,43,17], [33,17,43,4], [74,21], [21,43,43,74,68,21]].
有人能帮我吗。

Python 3:

newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']]
mylist = list(map(lambda x : list(map(int, x[0].split(','))) , newlist))
print(mylist)
Python 2:

newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']]
mylist = map(lambda x : map(int, x[0].split(',')) , newlist)
print mylist