Python Object-Oriented Python Inheritance Instances

Manuel Cisera
Manuel Cisera
4,250 Points

Create a function named combiner that takes a single argument, which will be a list made up

it says that the operation += can't be done fot int + list and i don't know how to fix it

instances.py
def combiner(args):
    sums = 0
    words = ""

    for arg in args:
        if isinstance (arg,str) == True:
            words += arg
        elif isinstance (arg,(int,float)) == True:
            sums += args

    answer = words + str(sums)
    return(answer)

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 57,147 Points

You are so close!

sums += args

# should be

sums += arg  # drop the last ā€œsā€