How to convert the list of JSON frames to a JSON frame


I want to convert List of JSON object ot Single JSON frame

Here is my code

for i in user1:
    user = { "name" : name,
              "password" : password,
    user = json.dumps(user)

I am getting output is

['{"password": "A123", "name": "Sam", "id": 1}', '{"password": "B123", "name": "Sammy", "id": 2}', '{"password": "C123", "name": "Abhi", "id": 3}']

What I want is something like

{{"password": "A123", "name": "Sam", "id": 1},{"password": "B123", "name": "Sammy", "id": 2},{"password": "C123", "name": "Abhi", "id": 3}}

json.dumps() returns a string, so you're append strings to userid—and thus end up with the list of strings shown.

If you want a dictionary of dictionaries using the id as the primary key, all you need is:

users = { {"name":, "password": i.password} for i in user1}