def te(oaaLicence):
list = {
"address": "张江路111弄22号1栋888室",
"banks": [
{
"accountName": "信息科技服务有限公司",
"bankName": "中国建设银行",
"bankNo": 77777,
"id": 1928822,
"oaaLicence": "666"
}
],
}
for i in list['banks']:
i['oaaLicence'] = oaaLicence
return i['oaaLicence']
k = te('78237832873')
print(k)
list['banks'][0]['oaaLicence'] = oaaLicence
return list['banks'][0]['oaaLicence']
以上两种方法都可行,去取oaaLicence的值,并赋值