fork download
  1. from pprint import pprint # for printing the final result in a pretty format
  2.  
  3. request_data = [
  4. {
  5. "id1": None,
  6. "id2": "test1",
  7. "id3": "test2",
  8. },
  9. {
  10. "id1": None,
  11. "id2": "test3",
  12. "id3": "test4",
  13. }
  14. ]
  15.  
  16. all_id2s = [entry['id2'] for entry in request_data]
  17.  
  18. pprint(all_id2s)
Success #stdin #stdout 0.02s 9484KB
stdin
Standard input is empty
stdout
['test1', 'test3']