Python中数组字符串互换

第一种:数组转换成字符串

p

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
>>> p2=[str(x) for x in p]
>>> p2
['2', '3', '5', '7', '11', '13', '17', '19', '23', '29', '31', '37', '41', '43', '47', '53', '59', '61', '67', '71', '73', '79', '83', '89', '97']

>>>

第二种:字符串转换为数组 

展开阅读全文

没有更多推荐了,返回首页