M
M
Michael2019-10-24 16:28:35
Python
Michael, 2019-10-24 16:28:35

What is the correct way to access a value in a JSON structure - python?

Good afternoon!
The people, I make an appeal to the api - GET, I get the output in json format.
Next, I want to display the values ​​​​of the key I need, it comes out only with the help of a loop - but this does not always work with different structures.
I can't figure out json.loads.
For example print(json.loads[{'name'}]) swears at the type, it is in list.
How to do it right?
Python3.6

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AWEme, 2019-10-24
@ARMADIK

json.loads(json_string)['name']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question