1. str转list
list = list(str)
2. list转str
str= ''.join(list)
3. tuple list相互转换
tuple=tuple(list)
list=list(tuple)
4. tuple 转换为字符串
In [1]: a = ('a',)
In [2]: ''.join(a)
Out[2]: 'a'
转载于:https://www.cnblogs.com/it-tsz/p/10582447.html
1. str转list
list = list(str)
2. list转str
str= ''.join(list)
3. tuple list相互转换
tuple=tuple(list)
list=list(tuple)
4. tuple 转换为字符串
In [1]: a = ('a',)
In [2]: ''.join(a)
Out[2]: 'a'
转载于:https://www.cnblogs.com/it-tsz/p/10582447.html