-3

Below is my code. I want to loop over this array in python, and want to get key and value of the json object. The json array is in another file. I have retrieved whole array in a variable.

[{'EJCx5IK2l': 'https://www.linkedin.com/in/pub/shane-coineandubh/9/22b/231'},
 {'EJDtW9tnl': 'https://www.linkedin.com/in/in/riccardo-ermini-75790b11'},
 {'EJDwgrFhg': 'https://www.linkedin.com/in/pub/guenter-sanwald/7/941/b72'}]
martineau
  • 119,623
  • 25
  • 170
  • 301

1 Answers1

0

For a json array called myJson:

for d in myJson: #for each dictionary in list
    for e in d:  #for each key in dictionary
       print('key is', e)
       print('value is', d[e])
johmsp
  • 296
  • 1
  • 8