title: Assign value to a nested list based on conditions specified by keys
body: <h1>Problem</h1>
  
  <p>I have a nested dictionary that looks like the following. Now I am trying to find an <strong>elegant</strong> way to assign value to replace 0's based on value of <code>b</code> and <code>f</code>.</p>
  
  <pre><code>{
      (a1, b1): {
          c1: {
              (d1, f1): 0, 
              (d2, f2): 0
          }
      },
      (a2, b2): {
          c2: {
              (d3, f3): 0
          }
      }
  }
  </code></pre>
  
  <h1>What I Have Done</h1>
  
  <p>I know I could use three loops to check whether conditions are met, but it is not very elegant and efficient either. </p>