Dangerous to go Alone


#1



Help please

https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/2/5?curriculum_id=4f89dab3d788890003000096

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']
    'backpack'.sort() 
    'backpack'.remove('dagger')
    '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'
inventory['pouch'].sort()


#2

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.


#3

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