I have a List:
entry=['A','B','C','null','B','A','D','null','E','F']
Letters (vertexes) adjacent to each other form an edge. 'null' is a separator.
Each edge has weight 1. Edge (A,B) has weight two, since it occurs twice.
To visualize, above list will be this graph:

I want to create a dictionary, similar to adjacency list.
dict= {
'A':{'B':2,'D',1},
'B':{'A':2,'C':1},
'C':{'B':1},
'D':{'A':1},
'E':{'F':1},
'F':{'E':1}
}
Where first key is a vertex, second keys are neighboring vertexes with its weight values.
How to come up with above graph. If there are any other better way of representation of above graph, I'd appreciate any help.