title: How to get Python to gracefully format None and non-existing fields
body: <p>If I write in Python:</p>
  
  <pre><code>data = {'n': 3, 'k': 3.141594, 'p': {'a': 7, 'b': 8}}
  print('{n}, {k:.2f}, {p[a]}, {p[b]}'.format(**data))
  del data['k']
  data['p']['b'] = None
  print('{n}, {k:.2f}, {p[a]}, {p[b]}'.format(**data))
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>3, 3.14, 7, 8
  Traceback (most recent call last):
    File "./funky.py", line 186, in &lt;module&gt;
      print('{n}, {k:.2f}, {p[a]}, {p[b]}'.format(**data))
  KeyError: 'k'
  </code></pre>
  
  <p>Instead of an error message, <strong>how can I get Python to more gracefully format the None's and non existent fields?</strong></p>
  
  <p>To give an example, I would like to see in the output something more like:</p>
  
  <pre><code>3, 3.14, 7, 8
  3, ~, 7, ~
  </code></pre>
  
  <p>Ideally, of course, I would like to be able to specify the string used instead of those missing values.</p>