Extracting json value from it's parent in python

So, hello everyone, I am making a url request and I want to parse it's response: {"hash160":"4b1ddbf92df072c298a0c58043db58b26771f926","address":"17rBT3f4UmnFGrngasBprqXjQQnZVztfDz","n_tx":0,"n_unredeemed":0,"total_received":0,"total_sent":0,"final_balance":0,"txs":[]}

I tried to extract values total_sent and final_balance like this: print(str(wallet['n_tx']['total_sent'])) and I got a Type Error: 'int' object is not subscriptable

Can you please tell me how can I extract those values?


Ответы (0 шт):