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 trialKia Matthews
3,402 PointsEventually 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:
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
231,236 PointsWhen I paste your original answer directly into the challenge, it does pass.
Iain Watson
3,031 PointsI had the same issue but my error was where I indented the return line
Kia Matthews
3,402 PointsKia Matthews
3,402 PointsThanks for the reply. I just tried it and it worked. I don't know why it wasn't accepting it yesterday :(