title: Why is this str.format causing a Key Error in Python
body: <p>I have the following code in a python 2.7.10 script</p>
  
  <pre><code>params = {'F': '250', 'I': '-22.5', 'J': '-22.5', 'Y': '12.817175976', 'X': '7.4', 'Z': '-50'}
  G3 = 'G3 F {F} I {I} J {J} X {X} Y {Y} Z {Z}  \n'
  print(params)
  print(G3)
  print(G3.format(params))
  </code></pre>
  
  <p>When I try to run it it gives the following output:</p>
  
  <pre><code>./g-codeGenerator.py
  {'F': '250', 'I': '-22.5', 'J': '-22.5', 'Y': '12.817175976', 'X': '7.4', 'Z': '-50'}
  G3 F {F} I {I} J {J} X {X} Y {Y} Z {Z} 
  
  Traceback (most recent call last):
    **Traceback truncated**
    File "./g-codeGenerator.py", line 342, in siliconOutputSequence
      print(G3.format(params))
  KeyError: 'F'
  </code></pre>
  
  <p>Why is this causing the key error, as far as I can see all of the required elements are present in the parameters?</p>