import ast
if __name__ == '__main__':
a = '[1,2,3,4,5]'
b: list = ast.literal_eval(a)
for i in b:
print(i)
python字符串数组转成数组list
最新推荐文章于 2024-04-27 14:22:18 发布
import ast
if __name__ == '__main__':
a = '[1,2,3,4,5]'
b: list = ast.literal_eval(a)
for i in b:
print(i)