• не принимает. Почему?

Question related to mission Currency Style

 
def checkio(line: str) -> str:
    if '$' not in line:
        return line    
    s = line.replace('\n', '%').split()
    text = ""  
    for simbol in s:      
        if simbol[-1] == '.':
            simb = simbol.rstrip('.')
            text += simb[ :-3].replace('.', ',') + simb[-3: ].replace(',', '.') + '.' + ' '
        elif '%' in simbol:
            a, b = simbol.split('%') 
            text += str(a)[ :-3].replace('.', ',') + str(a)[-3: ].replace(',', '.') + '%' + b + ' '   
        else: 
            text += simbol[ :-3].replace('.', ',') + simbol[-3: ].replace(',', '.') + ' '
    return text.replace('%', '\\n').rstrip()