Adding to a dictionary in python. Python text rpg
<p>I'm making a text rpg and I need some help, which I'm not entirely sure how to explain.</p>

<p>I need to make it so that the user can input something like "examine key" and it will print "it's a key".</p>

<p>I'm using 2 files.</p>

<p>main.py
engine.py</p>

<p>main.py needs to be able to append an object into a dictionary in the file engine.py</p>

<p>If engine.py has</p>

<pre><code>objects = {

}
</code></pre>

<p>and main.py has</p>

<pre><code>key = {'it's a key', 'key taken'}

engine.objects.append(key)
</code></pre>

<p>my main loop should be able to be like</p>

<pre><code>if choice[0] == 'examine':
    if choice[1] == anything in objects:
        print whatever object[0]
</code></pre>

<p>If that makes any sense at all can you point me in the right direction.</p>

<p>EDIT:
I can't append to a dictionary.</p>

<pre><code>    Traceback (most recent call last):
  File "...\main.py", line 5, in &lt;module&gt;
    engine.objects.append(key)
AttributeError: 'dict' object has no attribute 'append'
</code></pre>

<p>EDIT2: Sorry for being such a noob at this.
whenever I type "examine" With no second paramiter it errors and closes. I realize why but i don't know how to fix it.</p>
