[nfbcs] Can anyone help me understand what I'm doing wrong here?

Lanie Molinar laniemolinar91 at gmail.com
Wed Jul 25 02:08:57 UTC 2018


Thanks. I figured it out. I forgot to return inventory. I also made 
another adjustment since it was returning two of certain items when 
there was only supposed to be one. Moving the setdefault() method under 
the if statement instead of above it fixed that. I think it looks good now.


On 7/24/2018 8:57 PM, Mike Gorse wrote:
> On Tue, 24 Jul 2018, Lanie Molinar via nfbcs wrote:
>
>>   Message=AttributeError("'NoneType' object has no attribute 'items'")
>
> I think that you almost have it. The 'NoneType' in the error suggests 
> that your function isn't being passed a dictionary, or any object at 
> all. The traceback is helpful here. Look at the line above your call 
> to displayInventory. Inv is assigned a value returned by 
> addToInventory, or is it? If you look at your addToInventory function, 
> then I think that you'll be able to see your problem.




More information about the NFBCS mailing list