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

igor corrales
igor corrales
2,474 Points

My function looks like is fine in my console but ......

When I check my work I just retrive a "Bummer: try again!!" but no any clues of why is not correct .....

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

2 Answers

Viraj Deshaval
Viraj Deshaval
4,874 Points

Code is correct, but issues in indentations so check for it and re-run. After function name with parameters provided we need to indent the body of the function with 4 white spaces. We choose 4 as a best practice.

def multiply(base, *args): total = base for num in args: total *= num return total