Issue In Mecha Munch Management / Phyton Instructions

First just wanted to say I think what you have built here is great and I like the environment and the development support. Found this while looking to learn Python in some spare time after years programming in other languages.

For the issue in the code we have the stub:

def add_item(current_cart, items_to_add):

but in the instructions for the exercise its

Create the function add_items(<current_cart>, <items_to_add>) that takes a cart dictionary and any list-like iterable of items to add as arguments. It should return a new/updated shopping cart dictionary for the user.

and:

add_items({ā€˜Bananaā€™: 3, ā€˜Appleā€™: 2, ā€˜Orangeā€™: 1},
(ā€˜Appleā€™, ā€˜Appleā€™, ā€˜Orangeā€™, ā€˜Appleā€™, ā€˜Bananaā€™))
{ā€˜Bananaā€™: 4, ā€˜Appleā€™: 5, ā€˜Orangeā€™: 2}

add_items({ā€˜Bananaā€™: 3, ā€˜Appleā€™: 2, ā€˜Orangeā€™: 1},
[ā€˜Bananaā€™, ā€˜Orangeā€™, ā€˜Blueberriesā€™, ā€˜Bananaā€™])
{ā€˜Bananaā€™: 5, ā€˜Appleā€™: 2, ā€˜Orangeā€™: 2, ā€˜Blueberriesā€™: 1}

Suggest it should be add_items!

2 Likes

Good catch!

Yes, in the Mecha Munch Management concept exercise the task #1 talks about a function named add_items (with an ā€œsā€) but the initial stub and the tests want the function add_item (without an ā€œsā€).

I believe the maintainers would accept a pull request if you want to fix the instructions.
Otherwise we would do that ourselves.
(@BethanyG Please correct me if Iā€™m wrong.)

1 Like

@siebenschlaefer @Tamarack-76 :wave:

Nice catch! Iā€™d be happy to accept a PR (just link it here when you are done). :smile: But letā€™s make sure to match the tests (so we donā€™t invalidate existing student solutions).

If I donā€™t hear from you, Iā€™ll go ahead and fix it by EOD tomorrow (Sept. 17th)

1 Like

Fixed and merged in PR 3774.

Please Note: Though this reads a little weird, I chose to not change the stub and test file function name because doing so would have invalidated over 2700 student solutions.

1 Like