title: catching `KeyError` and replacing with MSG
body: <p>am querying a <code>JSON</code> dict where there's some keys is not available.</p>
  <p>my aim is to type <code>N/A</code> for the key which <code>KeyError</code> occurs in then write to file.</p>
  <pre><code>goal = ['name', 'age', 'gender']
  
  
  for item in r['data']:
      final = [item[x] for x in goal]
      writer.writerow(final)
  </code></pre>
  <p>I know that can be done via <code>Try/Except</code> but i don't know how to handle it correctly</p>
  <pre><code>try:
      final = [item[x] for x in goal]
  except KeyError as e:
      # from here am struggling
  
  </code></pre>
  <p>Example:</p>
  <pre><code>g = [
      {'name': 'ahmed', 'age': '10', 'gender': 'M'},
      {'name': 'mohamed', 'age': '20'},
      {'name': 'ramy'}
  ]
  
  </code></pre>
  <p>Desired output:</p>
  <pre><code>['ahmed', '10', 'M']
  ['moahmed','20','N/A']
  ['ramy','N/A','N/A']
  </code></pre>