- a 整型列表
- b 整型字符串列表
- c 字符串
- d 整形列表(与a相同)
import random
a = list(random.randint(1,9) for i in range(10))
print('a = ',a)
b = list(map(str,a))
print('b = ',b)
c = ''.join(b)
print('c = ',c,'\ttype(c) = ',type(c))
d = list(map(int,c))
print('d = ',d)
输出:
a = [6, 4, 5, 4, 3, 9, 4, 3, 4, 7]
b = ['6', '4', '5', '4', '3', '9', '4', '3', '4', '7']
c = 6454394347 type(c) = <class 'str'>
d = [6, 4, 5, 4, 3, 9, 4, 3, 4, 7]