title: Python iterate through YAML
body: <p>How can one iterate through:</p>
  
  <pre><code>A:
    A1: 1000
    A2:
      A2A:
        A2A1: 100
        A2A2: 250
        A2A3: 250
      A2B:
        A2B1: 100
        A2B2: 300
     A3:
       A3A:
         A3A1:
           A3A1A: 200
           A3A1B: 100
           # There could be more values
  </code></pre>
  
  <p>I want to add the values of <code>A3A1A</code> and <code>A3A1B</code> and other values in the same place</p>
  
  <p>I tried the following:</p>
  
  <pre><code>    with open("foobar.yml", 'r') as stream:
              foobar = yaml.load(stream)
      end_value = 0
          for one_value in foobar["A1"]["A3"]["A3A"] ["A3A1"][*]:
             end_value = end_value + one_value 
  </code></pre>
  
  <p>but this doesn't work</p>