l = [{"Task": "true", "People": "John"}, {'name': '123'}]
for item in l:
x = item
x['z'] = x.pop('name')
print(x)
请问如果我想要达到如果该字典中没有name值则continue,如果有则替换key值为z,该怎么写?
就是if ( ):
continue
括号里的写法查不到类似的,恳请赐教
l = [{"Task": "true", "People": "John"}, {'name': '123'}]
for item in l:
x = item
x['z'] = x.pop('name')
print(x)
请问如果我想要达到如果该字典中没有name值则continue,如果有则替换key值为z,该怎么写?
就是if ( ):
continue
括号里的写法查不到类似的,恳请赐教