# 把 x 中的变量类型由字符串变为 int
x = [ '1', '2', '3' ]
x = list(map(int, x))
python3 中 list 中的元素类型转换,由 str 转成 int
最新推荐文章于 2024-06-17 09:16:09 发布
# 把 x 中的变量类型由字符串变为 int
x = [ '1', '2', '3' ]
x = list(map(int, x))