Python Object-Oriented Python Inheritance Instances

kalyada leosrisook
kalyada leosrisook
Pro Student 15,261 Points

Why is this not correct, when I got the right answer on my local IDE

I am not sure what I'm doing wrong. I did this on my IDE and I got the correct answer but for some reason it doesn't seem to work here .
    def combiner(items):
        numCount = 0
        word = ""
        for item in items:
            if(isinstance(item,(int,float)) ):
                numCount += item
            elif(isinstance(item, str)) :
        return "{}{}".format(word,numCount)

1 Answer

William Li
William Li
7,935 Points

I don't think string objects have an "append" method. Instead of



word += item