how can i create a list of dictionaries in python : i have a dictionary and tuple of friendship i need to create a list of dictionaries that each key the person and the values are his friends

    users=[{"id":0,"name":"hero"},{"id":1,"name":"Dunn"},{"id":2,"name":"Sue"},{"id":3,"name":"Chie"},{"id":4,"name":"Thor"},
       {"id": 5, "name": "Clive"},{"id":6,"name":"Hicks"},{"id":7,"name":"Devin"},{"id":8,"name":"Kate"},{"id":9,"name":"kelin"}]

    
    friendships = [(0, 1), (0, 2), (1, 2), (1, 3), (2, 3), (3, 4),
    (4, 5), (5, 6), (5, 7), (6, 8), (7, 8), (8, 9)]


    
    friend={}
    friends=[]
    for i in users:
        for j,k in friendships:
            if i['id']==j:
                friend[i['name']]=k
                friends.append(friend)




