title: How do I make hierarchical lists python
body: <p>I'm trying to create hierarchy lists python in python. For example, There are several states. In each state there are several counties, in each county they are several cities. Then I would like be able to call those.
  I've tried creating list and appending lists to those list but I can't get to that to work. It also gets really messy. Thanks</p>
  
  <p>I just found this example:</p>
  
  <pre><code>tree = [
      ['Food', [
           ['Fruit', [
                 ['Red', ['Cherry', 'Strawberry']],
                 ['Yellow', ['Banana']],
           ]],
           ['Meat', [
                 ['Beef', 'Pork']
           ]],
      ]],
  ]
  </code></pre>
  
  <p>Now my question would just be, is this the best way? how to call specific things? If I use...</p>
  
  <pre><code>print tree[0]
  </code></pre>
  
  <p>it will give me everything. When I try </p>
  
  <pre><code>print tree[0[1]]
  </code></pre>
  
  <p>I get a type TypeError: 'int" object has no attribute '__getitem_'
  Thanks</p>