Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Tuples Packing

Feedback

This is not a request for help, this is feedback about "check my work" and the messages it returns.

In my code I had a typo wherein a variable named args was typed as arg. The problem is that the error message I got was "couldn't find multiply".

WTF? That is totally confusing and not even a little bit helpful. Many of the error messages are like that and I frequently have to pull my code out to run on my PC which kind of defeats the purpose of the web based interpreter.

Feedback: Show the student the actual error message instead of nonsense that will leave them confused and frustrated.

twoples.py
def multiply(*args):
    product = 1
    for num in arg:
        product *= num
    return product

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Thanks for the feedback. That is a confusing error message. Treehouse is in the process of improving the challenges to provide more meaningful responses.

In this case, because of the typo on "arg", it raises a NameError since it hasn't been defined. This causes the parser to stop without finishing the compile of the multiply function. Hence, when the checker tries to run the code, no "multiply" is found. This error is similar to the error "Task 1 is no longer working". Both scenarios are caused by newly introduced typos that break the current code or previously passing code. B