Multiple dictionaries causing AttributeError?
<p>I have 1 variable that contains multiple dictionaries:</p>

<pre><code>a = {"foo": "foo"}, {"foo2": "foo2"}
</code></pre>

<p>But if I do:</p>

<pre><code>a.get("foo")
</code></pre>

<p>it returns as <code>AttributeError</code>:</p>

<pre class="lang-none prettyprint-override"><code>AttributeError: 'tuple' object has no attribute 'get'
</code></pre>

<p>Multiple dictionaries does not exist in Python.
If you define <code>a</code> as:</p>

<pre><code>a = {"foo": "foo"}, {"foo2": "foo2"}
</code></pre>

<p><code>a</code> will be a <code>tuple</code>. So you have to call the element as follow:</p>

<pre><code>a[0].get("foo")
</code></pre>

<p>To use <code>a.get</code> method you have to define <code>a</code> as follow:</p>

<pre><code>a = {"foo": "foo", "foo2": "foo2"}
</code></pre>

<p>Now <code>a.get("foo")</code> call will have as output <code>"foo"</code>.</p>

python dictionary tuples attributeerror