Format on python string gives error : <p>In python, I'm trying to create a string by format()</p>

<pre><code>json_data_resp = '{"error":false,"code":"{0}","mac":"{1}","message":"Device configured successfully"}'.format(activation_code, macaddress)
</code></pre>

<p>When I execute this code, it gives me an error like so:</p>

<blockquote>
  <p>KeyError: '"error"'</p>
</blockquote>

<p>What is it that I'm doing incorrectly?</p>
