Skip to content
Brainlag
  1. Library
  2. Challenges
  3. Python

Merge two game inventories

Two players pool their loot. Merge two inventory dictionaries into a new one, add up shared items and cap each stack at 99.

PythonCore20 minCode

Code

Inside: 3 checks, no scaffolding.

See what’s includedAlready have Brainlag Code? Sign in

Code editor. Press Control or Command plus Enter to run the code. Tab indents; to move focus out of the editor, press Escape and then Tab.