2024-10-06 16:22:13 发布
网友
我把这些数据转换成整数
['8737', '5330', '7463'] ['690', '7227'] ['4043', '1572'] ['8334', '3227', '5642'] ['3705', '3522']
我使用枚举来完成它:
for index, item in enumerate(list_a): list_a[index] = int(item)
有其他方法来完成它吗?我试着用sting.atoi()来完成它,但它只能将字符串转换成整数
当然,你可以用^{}来做这个
list_a = list(map(int, list_a))
当然,你可以用^{} 来做这个
list_a = list(map(int, list_a))
相关问题 更多 >
编程相关推荐