-4

I have a JSON file that looks as follows:

{"-Kh8M0qTdXJ-vBXr1G8v":{"email":"maad@yahoo.com","user":"amad"},"-Kh8M0v7KubmISGYrzks":{"email":"maad@yahoo.com","user":"amad"},"-KhB5OYsWias6j4Mc-pX":{"email":"faraz@yahoo.com","user":"faraz"},"-KhBBZ5Ii6kHPoUFhbj8":{"email":"zeeshan@gmail.com","user":"zeeshan"},"-KhBDTyGM9LaojajmtQv":{"email":"Ali@gmail.com","user":"Ali"}}

I want to print all email and user values. Can anyone help, how can I fetch these values from JSON using python?

BusyProgrammer
  • 2,783
  • 5
  • 18
  • 31
Amad
  • 314
  • 1
  • 6
  • 25

1 Answers1

0
for d in json_dict.values():
    print(d['user'], ':', d['email'])

Where json_dict is the json file you've got

m0nhawk
  • 22,980
  • 9
  • 45
  • 73
Pitu
  • 51
  • 1
  • 4