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

Eventually passed the challenge, but I don't understand why my first try was incorrect.

After reading the forum, I submitted the following code and passed the challenge:

twoples.py
def multiply(base, *nos):
    total = base
    for num in nos:
        total *= num
    return total

but originally I answered:

def multiply(*nos):
    total = 1
    for num in nos:
        total *= num
    return total

I don't understand why my original answer failed the challenge.

2 Answers

Steven Parker
Steven Parker
231,236 Points

When I paste your original answer directly into the challenge, it does pass.

Thanks for the reply. I just tried it and it worked. I don't know why it wasn't accepting it yesterday :(

Iain Watson
Iain Watson
3,031 Points

I had the same issue but my error was where I indented the return line