Convert String to Dict or List in Python?

后端 未结 2 564
谎友^
谎友^ 2021-01-16 19:19

convert this string to list or dictionary in python?

[\'[\', \'{\', \'u\', \"\'\", \'f\', \'i\', \'r\', \'s\', \'t\', \'_\', \'n\', \'a\', \'m\', \'e\', \"\'         


        
2条回答
  •  走了就别回头了
    2021-01-16 19:54

    It is itself a list and you are saying to convert it to list! Try print type(a) by assigning given code as a !! Then you will get

    
    

    as output!

提交回复
热议问题