R
R
Roofchick2020-02-25 22:45:53
Python
Roofchick, 2020-02-25 22:45:53

How to get data from JSON using Python?

There is JSON:
{
"A": {
"B": D,
"C": [1, 2, 3, ...]
}
}
We need to get the list [1,2,3...] from it using Python .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan, 2020-02-25
@DollaR84

import json
with open('file.json', 'r') as f:
    c = json.load(f)['a']['c']
    print(c)

L
Larisa .•º, 2020-02-26
@barolina

this is example
https://repl.it/@Barolina/WiryMeanSite

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question