小编Abh*_*Raj的帖子

使用Python将此列表转换为Dictionary

list = ['Name=Sachin\n', 'country=India\n', 'game=cricket\n']
Run Code Online (Sandbox Code Playgroud)

我想这个名单在字典中的钥匙为Name,country,game和值Sachin,India,cricket作为相应的值.我readlines()从文本文件中获取了此列表.

python list

4
推荐指数
1
解决办法
103
查看次数

标签 统计

list ×1

python ×1