If i write the code I have included in this post. I get this error.
Traceback (most recent call last):
File "python", line 15, in
AttributeError: 'NoneType' object has no attribute 'remove'
If I write the other code I have included in this post, it works fine. Why is that?
I expected to be able to execute two list functions in one line.
#This works inventory['backpack'].sort() inventory['backpack'].remove('dagger') #This doesn't work. Why is that? inventory['backpack'].sort().remove('dagger')