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

Hara Gopal K
PLUS
Hara Gopal K
Courses Plus Student 10,027 Points

instances.py, bummer all the way

what seems to be the issue

instances.py
def combiner(*args):
    lst = []
    number = 0    
    for item in args:
        if isinstance(item, str):
            lst.append(item)
        elif isinstance(item, (int, float)):
            number += item
        else:
            raise ValueError
    return ''.join(lst) + str(number)

2 Answers

AJ Salmon
AJ Salmon
5,675 Points

You don't need to be using *args for this one! It says the argument to the function will be a list, so you know exactly how many arguments there will be (1) and what type of argument it is (list). Use that to your advantage!

Hint: You won't need to change much at all. Instead of telling the function to take any arguments, just tell it to take one. You could do this by simply deleting the packer operand (the asterisk) in the parameter. The rest of your code works perfectly! Hope this helps,

AJ

Hara Gopal K
PLUS
Hara Gopal K
Courses Plus Student 10,027 Points

Thanks AJ,

it worked as you said. hope its to do with the work-spaces and not a coding error. it works in my IDE.

Cheers Hara