Files
python/exercises/concept/inventory-management/dicts.py

56 lines
1.5 KiB
Python
Raw Normal View History

"""Functions to keep track and alter inventory."""
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
def create_inventory(items):
"""Create a dict that tracks the amount (count) of each element on the `items` list.
:param items: list - list of items to create an inventory from.
:return: dict - the inventory dictionary.
"""
pass
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
def add_items(inventory, items):
"""Add or increment items in inventory using elements from the items `list`.
:param inventory: dict - dictionary of existing inventory.
:param items: list - list of items to update the inventory with.
:return: dict - the inventory updated with the new items.
"""
pass
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
def decrement_items(inventory, items):
"""Decrement items in inventory using elements from the `items` list.
:param inventory: dict - inventory dictionary.
:param items: list - list of items to decrement from the inventory.
:return: dict - updated inventory with items decremented.
"""
pass
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
2021-09-06 13:48:38 +05:30
def remove_item(inventory, item):
"""Remove item from inventory if it matches `item` string.
2021-09-06 13:48:38 +05:30
:param inventory: dict - inventory dictionary.
:param item: str - item to remove from the inventory.
:return: dict - updated inventory with item removed. Current inventory if item does not match.
"""
2021-09-06 13:48:38 +05:30
2022-04-16 17:03:24 -07:00
pass
2021-09-06 13:48:38 +05:30
Implement new Concept Exercise: dicts (new PR) * Added it again * Updated the following to the requested changes. * Fixed some spelling in after.md * Add stuff to after.md * formatting * Some touches here and there and added example.py * Create test * Update dicts_test.py * formatting * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/dicts_test.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/hints.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/after.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update after.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/design.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update design.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> * Rewriting introduction.md and adding some stuff to after.md * Update example.py * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com> * Update introduction.md * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update languages/exercises/concept/dicts/.docs/instructions.md Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> * Update instructions.md * Rework * Update introduction.md * Update languages/exercises/concept/dicts/.meta/example.py Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com> Co-authored-by: BethanyG <BethanyG@users.noreply.github.com> Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
2020-08-03 20:15:59 +02:00
def list_inventory(inventory):
"""Create a list containing only available (item_name, item_count > 0) pairs in inventory.
:param inventory: dict - an inventory dictionary.
:return: list of tuples - list of key, value pairs from the inventory dictionary.
"""
pass