Light Mode
Dark Mode
не принимает. Почему?
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()
Created: Feb. 9, 2023, 1:28 p.m.
Updated: May 15, 2023, 5:12 a.m.
0
15
User avatar
cool.tugaev