Python Lists and Dictionaries


Oops, try again. Make sure to add 50 to the gold total!

the error messages may not express all my error, I mistake the dic and list, so I can not correctly answer.
who can kindly tell me Is there a correct and more simple way to solving it? thanks a lot!

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

# 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'

# Your code here

inventory['pocket'] = ['seashell', 'strange berry','lint']





inventory['gold']=[500+50] (why're you putting the value in a list? )

You have to increase value of gold key by 50

x is an integer.

x = 40

I want to increase its value by 30, I'd do this..
x = x + 30

Keep in mind that there you have to use key gold that have corresponding value 500 now.
You need to increase it's value by 50.


I know,I don't know how to increase the 50? I used to try..


How can I show the calculating process?


Thanks a lot, I succeed.




How did you figure this out? I never would've guessed += to add the numbers based on everything learned.

Good job, by the way!


I guess it likes:


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