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 minPremium

Premium

Inside: 3 checks, no scaffolding.

See Premium£7.99 a month. Already Premium? 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.