有个字典列表是这样:
l = [
{"name": "mqx", "url": "www.google.com"},
{"name": "mqx", "url": "www.baidu.com"},
{"name": "other", "url": "www.baidu.com"},
]
希望的输出是:
output = [
{"name": "mqx", "url": ["www.google.com", "www.baidu.com"]},
{"name": "other", "url": "www.baidu.com"},
]
请问有什么好的方法吗,希望大神不令赐教
l = [
{"name": "mqx", "url": "www.google.com"},
{"name": "mqx", "url": "www.baidu.com"},
{"name": "other", "url": "www.baidu.com"},
]
希望的输出是:
output = [
{"name": "mqx", "url": ["www.google.com", "www.baidu.com"]},
{"name": "other", "url": "www.baidu.com"},
]
请问有什么好的方法吗,希望大神不令赐教