发布时间:2019-08-26 07:19:24编辑:auto阅读(2606)
字符串转列表
s = 'abc'
a = list(s)
['a','b','c']
列表转为字符串
''.join(a)
字符串转换为元组
s='abc'
t = tuple(s)
元组转换为字符串
''.join(t)
列表转换为元组
l = ['a','b','c']
tuple(l)
元组转换为列表
t = ('a','b','c')
list(t)
['a','b','c']
字典转换为列表
dic={'a':1,'b':2}
dic.items()
[('a',1),('b',2)]
列表转换为字典
list1 = dic.items()
dict(list1)
上一篇: Python第三方库paramiko S
下一篇: python学习--正则表达式
54136
40893
35411
31045
25938
25673
24125
19658
15727
15193
1955°
1803°
1889°
1974°
1960°
2143°
2101°
1915°
1999°
1981°