Dangerous to go Alone


Help please


File "python", line 3
'pouch': ['flint', 'twine', 'gemstone'],
SyntaxError: invalid syntax

Replace this line with your code. 

inventory = {
    'gold' : 500,50 
    'pouch': ['flint', 'twine', 'gemstone'],
    # Assigned a new list to 'pouch' key
    'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']
    'pocket': ['seashell', 'strange berry', 'lint'

# Adding a key 'burlap bag' and assigning a list to it
inventory['burlap bag'] = ['apple', 'small ruby', 'three-toed sloth']

# Sorting the list found under the key 'pouch'


Those lines are illegal inside a dictionary. Fortunately the syntax error came before that point. There needs to be comma after the line above where the error is indicated.

Also, check that your pocket has a closing bracket.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.