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)
”二维“dict

 

posted @ 2018-05-30 16:30  PKICA  阅读(405)  评论(1编辑  收藏  举报