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

posted @ 2018-09-13 22:19  tao之夭夭  阅读(628)  评论(0编辑  收藏  举报