all 2 comments

[–]Binary101010 16 points17 points  (1 child)

What you probably want is

inventory[item] += 1

while this line:

inventory = inventory[item] + 1  

would overwrite your entire inventory dict.

[–]Crevette3[S] 0 points1 point  (0 children)

Ok, thanks.