python之json
1 body = {} 2 3 item = {} 4 item['one'] = 'vip1' 5 item['two'] = 'vip2' 6 body.update({'vip':item}) # not exist 7 print(body) 8 9 # if exist 10 item['three'] = 'vip3' 11 body['vip'].update(item) 12 print(body)
1 body = {} 2 3 item = {} 4 item['one'] = 'vip1' 5 item['two'] = 'vip2' 6 body.update({'vip':item}) # not exist 7 print(body) 8 9 # if exist 10 item['three'] = 'vip3' 11 body['vip'].update(item) 12 print(body)