至尊宝的传说
一、字符串转换成列表二、字符串转换成字典三、字符串转换成元组eval函数就是实现list、dict、tuple与str之间的转化str函数把list,dict,tuple转为为字符串回到顶部一、字符串转换成列表a = "[[1,2], [3,4], [5,6], [7,8], [9,0]]"print(type(a))b = eval(a)print(type(b))print(b)请点击输入图片描述回到顶部二、字符串转换成字典a = "{1: 'a', 2: 'b'}"print(type(a))b = eval(a)print(type(b))print(b)回到顶部三、字符串转换成元组a = "([1,2], [3,4], [5,6], [7,8], (9,0))"print(type(a))b=eval(a)print(type(b))print(b)