list,string,tuple,dictionary之间的转换
list,string,tuple,dictionary之间的转换
| 类型 | String | List | tuple | dictionary |
|---|---|---|---|---|
| String | - | list(str), str.split() | tuple() | - |
| List | ‘’.join(list_name) | - | tuple() | dict(list) |
| tuple | - | list(tuple) | - | dict(tuple) |
| dictionary | - | dic.items() | tuple (dic.items()) |
转自:https://blog.csdn.net/YQ1228/article/details/78542035

浙公网安备 33010602011771号