Answer the question
In order to leave comments, you need to log in
How to remove block from Json response?
myrequest = json.loads(x)
r = requests.post(url, json=myrequest)
result = r.json() #
[{u'aa': 11, u'price': {u'max':11, u'min': 4}}]
for e in result[0]:
print(e)
if 'price' in e:
del e['price']
Answer the question
In order to leave comments, you need to log in
Why loop through the dictionary? ( you have a dictionary, not a list)
you can justresult[0]
if 'price' in result[0].keys():
del result[0]['price]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question