Can get new line in Python 3.6.3 (new format) :     f.write(f'[{str(train_time[i])}] № {str(train_number[i])} {str(train_direct[i])}\n')

'\n' does not works?!

Here is the all block of code

    import re

    with open('input.txt', 'r', encoding='utf-8') as f:
        text = str(f.read())
        train_time = re.findall(r'\d{3}\s\w+\s\w{1,2}.+(\d{2}\:\d{2}\:\d{2})', text)
        train_number = re.findall(r'(\d{3})\s\w+\s\w{1,2}.+\d{2}\:\d{2}\:\d{2}', text)
        train_direct = re.findall(r'\d{3}\s\w+\s(\w{1,2}\s\w+)', text)
        
    with open('output.txt', 'w+', encoding='utf-8', newline='\n') as f:
        i = 0
        for i in range(len(train_number)):
            f.write(f'[{str(train_time[i])}] № {str(train_number[i])} {str(train_direct[i])}\n')