Little Sister's Vocabulary not passed test 3

exercism code:
def remove_suffix_ness(word):
“”"Remove the suffix from the word while keeping spelling in mind.

:param word: str - of word to remove suffix from.
:return: str - of word with suffix removed & spelling adjusted.

For example: "heaviness" becomes "heavy", but "sadness" becomes "sad".
"""
words_sufix = []
for sufix in word:
    if sufix.endswith('iness'):
        sufix = sufix[:-5]
        sufix = sufix + 'y'
        words_sufix.append(sufix)
        continue
    sufix = sufix[:-4]
    words_sufix.append(sufix)
return words_sufix

It doesn’t pass the tests, but python tutor tests it and it does pass the test.

python tutor code:

def remove_suffix_ness(word):
“”"Remove the suffix from the word while keeping spelling in mind.

:param word: str - of word to remove suffix from.
:return: str - of word with suffix removed & spelling adjusted.

For example: "heaviness" becomes "heavy", but "sadness" becomes "sad".
"""
words_sufix = []
for sufix in word:
    if sufix.endswith('iness'):
        sufix = sufix[:-5]
        sufix = sufix + 'y'
        words_sufix.append(sufix)
        continue
    sufix = sufix[:-4]
    words_sufix.append(sufix)
return words_sufix

remove_suffix_ness([‘heaviness’, ‘sadness’, ‘softness’, ‘crabbiness’, ‘lightness’, ‘artiness’, ‘edginess’])

The unit tests pass in a single word, not a list of words. Running “tests” without using the test runner often doesn’t test the right thing. Reading the test details/output typically shows what the issue is. You might need to click another “TEST FAILURE” variant to expand and see the details.

I understand, it can work, I’ll try it and let you know, I thought the result was a list of words since that’s what the test said what the expect_data was.

If you read the test output from that test it should say something about looking at specific variants for details of what’s actually happening. You want to expand the failures beneath that.

Ty

if word.endswith('iness'):
    word = word[:-5]
    word = word + 'y'
    return word
word = word[:-4]
return word