【发布时间】:2021-05-11 22:53:53
【问题描述】:
输入:
"name=xyz,city=bangalore,company=abc,education=BE"
输出:
{"name":"xyz", "city":"bangalore", "company":"abc", "education":"B.E"}
我可以得到['name=xyz', 'city=bangalore', 'company=abc', 'education=BE']
但我坚持拆分列表中的单词并附加到字典。
【问题讨论】:
-
再分一次?
-
你是怎么把它变成
list的?如果您在=上拆分,则应使用相同的过程将其放入dict。 -
@Tomerikoo
s.split(',')?你错过了s...
标签: python python-3.x