It's Dangerous to Go Alone! Take This


#1

inventory['backpack'].remove('dagger')

why can't i write this code like this:

inventory['backpack'].remove[2]


#2

because the .remove() function removes the matching value, not based on index. You can remove based on index, but then you need del:

inventory['backpack'].del[2]

not sure if the exercise will like that, but the output should be good


#3

A post was split to a new topic: It is dangerous to go alone! take this