fork download
  1. resp={
  2. "A" : {
  3. "uni" :
  4. [
  5. {
  6. "Name" : "cc",
  7. "Id" : "1",
  8. },
  9. {
  10. "Name" : "cc",
  11. "Id" : "1",
  12. }
  13. ]
  14. }
  15. }
  16.  
  17. key, value = resp["A"].popitem()
  18. print(1,key)#this key is the "uni/aa/bb" value that may change
  19. for item in value:
  20. print(2,item) #the object that is present in the array, so after each iteration the item object will change, that is first object in the array then second object in the array and so on
  21. print(3,item["Name"])# and now are accessing the Name project of that object
  22.  
Success #stdin #stdout 0.02s 28376KB
stdin
Standard input is empty
stdout
1 uni
2 {'Id': '1', 'Name': 'cc'}
3 cc
2 {'Id': '1', 'Name': 'cc'}
3 cc