我希望从下面的列表中创建一个词典。
结果应该以名称作为键,以“美国”作为值。
例如:
[{'fips': '01001', 'state': 'AL', 'name': 'Autauga County'}, {'fips': '20005', 'state': 'KS', 'name': 'Atchison County'}, {'fips': '47145', 'state': 'TN', 'name': 'Roane County'}]
结果应该以名称作为键,以“美国”作为值。
例如:
{'Autauga County': 'United States', 'Atchison County' : 'United States', 'Roane County' : 'United States'}
我可以用几个for循环来实现这个,但我想学习如何使用字典解析来实现。