list,内str元素转换为int

a=['1','2','3','4','5','6']
b=list(map(int,a)]
print(b)
>>>
1,2,3,4,5,6

使用map函数来转换

posted on 2018-03-28 09:57  Haha.chen  阅读(1472)  评论(0编辑  收藏  举报

导航