title: Creating Adjacency List in Python using Dict and List
body: <p>I wanted to create a data structure that can store the name of a vertex, vertices it is adjacent to along with the edge weight. I thought of creating a <code>dict</code> that maps a vertex to a <code>list</code> that further has <code>dict</code> to store vertices it is adjacent to with edge weight. </p>
  
  <p>In other words:</p>
  
  <pre><code>D = {
      vertex1: [
          {
              Adj_vertex1: edge weight
          }, 
          {
              Adj_vertex2:    edge weight
          } 
      ]
  }
  </code></pre>
  
  <p>Is there an effective way to do this? Also, if I use the structure above how do I access <code>Adj_vertex2</code>? </p>