• Help

Question related to mission Second Index


def second_index(text: str, symbol: str, ) -> [int, None]:

if not symbol in text and text.count(symbol) < 2:
    return None
    return text.find(symbol, text.find(symbol) + 1)

I wrote the code above which works fine with all assertions except for the fourth (assert second_index("hi mayor", "") is None, "Fourth"), there I get -1 as a result.