Directories - Why is this erroring out?
<p>I am building a few directories for a program I am working on, but they keep erroring out when used within the game and without of it. Each line throws out the same error (<code>Syntax Error: invalid syntax</code>) and I am wondering why. The lines are:</p>

<pre><code>secretpassageunearthed = 'No'
pickedup = {'broom': '0', 'rope': '0', 'torch': '0', 'coffin': '0', 'skeleton' = '0', 'key2': '0', 'rock': '0', 'key1': '0', 'mailbox': '0', 'instructions': '0', 'letter': '0', 'key3': '0', 'oar': '0', 'boat': '0', 'red button': '0', 'eaglenest': '0', 'faberge egg': '0', 'trophy case': '0', 'facial': '0', 'gun': '0', 'safe': '0', 'diamond ring': '0', 'junk': '0', 'combination': '0', 'egg': '0', 'flashlight': '0', 'cork': '0', 'bottle': '0', 'oil': '0', 'crown': '0', 'shovel': '0', 'knob': '0', 'twinkies': '0', 'scanner': '0', 'toychest': '0'}
#has the player been in the room?
beenin = {'frontdoor': '0', 'forest': '0', 'forest2': '0', 'forest3': '0', 'forest4': '0', 'lakeshore': '0', 'garden': '0', 'shed': '0', 'lake': '0', 'farshore': '0', 'cliff1': '0', 'cliff2': '0', 'cliff3': '0', 'cliff4': '0', 'clifftop': '0', 'frontsteps': '0', 'frontlawn': '0', 'gate': '0', 'sittingroom': '0', 'livingroom': '0', 'pantry': '0', 'foyer': '0', 'trophyroom': '0', 'hall1': '0', 'diningroom': '0', 'kitchen': '0', 'elevatorup': '0', 'hall3': '0', 'hall2': '0', 'masterbed': '0', 'closet': '0', 'nursery': '0', 'bath': '0', 'guestroom': '0', 'study': '0', 'secretroom': '0', 'servantdining': '0', 'servantbath': '0', 'servantroom': '0', 'boilerroom': '0', 'mechanicalroom': '0', 'winecellar': '0', 'deadend': '0', 'torturechamber': '0', 'morgue': '0'}
maxweight = 50
weights = {'broom': 5, 'rope': 8, 'torch': 5, 'coffin': 40, 'skeleton': 9, 'key1': 2, 'key2': 1, 'rock': 4, 'instructions': 0, 'mailbox': 60, 'letter': 1, 'gargoyle': 60, 'key3': 1, 'blockade': 60, 'oar': 5, 'boat': 30, 'button': 1, 'eagle nest': 60, 'faberge egg': 10, 'trophy case': 60, 'book': 3, 'facial': 1, 'gun': 3, 'safe': 60, 'diamondring': 5, 'junk': 1, 'combo': 1, 'egg': 1, 'flashlight': 3, 'oil': 4, 'bottle': 3, 'cork': 1, 'chandelier': 60, 'crown': 5, 'shovel': 5, 'knob': 3, 'twinkies': 2, 'pot of gold': 30, 'painting': 20, 'scanner': 60, 'toychest': 55} 
</code></pre>

<p>Any help on why they are erroring out would be appreciated.</p>

<p>The <a href="https://www.python.org/dev/peps/pep-0008/#id19" rel="nofollow">python style guide</a> recommends keeping lines &lt; 72 characters. Personally, I aim for 78. If you do that, your code is easier to read and as a bonus, its easier to spot problems. So for example, if you file was </p>

<pre><code>secretpassageunearthed = 'No'
pickedup = {'broom': '0', 'rope': '0', 'torch': '0', 'coffin': '0',
'skeleton' = '0', 'key2': '0', 'rock': '0', 'key1': '0', 'mailbox': '0',
'instructions': '0', 'letter': '0', 'key3': '0', 'oar': '0', 'boat': '0',
'red button': '0', 'eaglenest': '0', 'faberge egg': '0', 'trophy case': '0',
'facial': '0', 'gun': '0', 'safe': '0', 'diamond ring': '0', 'junk': '0',
'combination': '0', 'egg': '0', 'flashlight': '0', 'cork': '0', 'bottle': '0',
'oil': '0', 'crown': '0', 'shovel': '0', 'knob': '0', 'twinkies': '0',
'scanner': '0', 'toychest': '0'}
</code></pre>

<p>You'd see that python points exactly at the problem</p>

<pre><code>td@mintyfresh ~/tmp $ python3 test.py
  File "test.py", line 3
    'skeleton' = '0', 'key2': '0', 'rock': '0', 'key1': '0', 'mailbox': '0',
               ^
SyntaxError: invalid syntax
</code></pre>

<p>You basically said "I wrote code that is hard to read and can't find the error".</p>

python directory adventure