I need help on how do I use python to access element from JSON structure.
Assuming I have a JSON like this
{
'result':
[
{
'aa':1,
'bb':2
},
{
'cc':3,
'dd':4
}
]
}
In python, how exactly to get the data for aa or dd ?
I tried with
str1 = {'result':[{'aa':1, 'bb':2},{'cc':3, 'dd':4}]}
str1new = str1['result']['aa]
but it gives me error
list indices must be integers, not str
How do I solve this? Is there any other method using python to get the data from JSON? Thank you for the help. I really appreciated it.