Python Object-Oriented Python Inheritance Instances

Daniel Smith
Daniel Smith
10,172 Points

I dont understand why my isinstance problem is off

The code i used worked in my external IDE, can someone shed some light?

instances.py
def combiner(lis):
    output = []
    result = ''
    nums = 0
    for elements in lis:
        if isinstance(elements, (int, float)):
            nums += elements
        elif isinstance(elements, str):
            result += elements
    output.append(result+str(nums))
    return output

1 Answer