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>You're assigning to variable a tuple of two elements which are dicts. </p>

<p>This:</p>

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

<p>is equivalent to:</p>

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

<p>so you cannot access to dictionary in this way you try. </p>

<pre><code>AttributeError: 'tuple' object has no attribute 'get'
</code></pre>

<p>tells you that you want to use <code>get</code> attribute on tuple, but tuple hasn't it.</p>

<p><strong>Solving issue</strong>:</p>

<p>You can assign to <code>a</code> variable for example one dict:</p>

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

<p>and in this case you can use:</p>

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

<p>which will print </p>

<pre><code>foo
</code></pre>

python dictionary tuples attributeerror