list,string,tuple,dictionary之间的转换

list,string,tuple,dictionary之间的转换

类型StringListtupledictionary
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

原文地址:https://www.cnblogs.com/yigui/p/9643609.html