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 at: 2023/02/09 13:28; Updated at: 2023/02/10 07:01