// Enter your code here
url = "https://8oi9s0nnth.apigw.ntruss.com/corona19-masks/v1/storesByAddr/json"
jdata = jdata['stores']
I want to show the dictionary corresponding to stores
and delete and show certain keys and values.
ex) I tried code to remove key values like del(dic['lat']) but I don't think it works.
I'm a beginner studying Python. I want to spray it on the screen through Python Django, but I can't try it, so I'm asking you this question
python django
import json
import requests
r = requests.get('https://8oi9s0nnth.apigw.ntruss.com/corona19-masks/v1/storesByAddr/json')
data = r.json()
for idx, i in enumerate(data['stores']):
dict = i
del(dict['code'], dict['created_at'])
data['stores'][idx] = dict
I've done it like this, but I think there might be another good way.
© 2024 OneMinuteCode. All rights reserved.