def main(): data_path = 'var/data/data.txt' result_path = 'var/result/result.txt' data = [] with open(data_path, "r") as data_file: data = list(map(lambda x: int(x), data_file.read().split())) with open(result_path, 'w') as result: result.write(f'{data[0] * data[-1]}') print(f'В файл {result_path} было записано {data[0] * data[-1]}') if __name__ == "__main__": main()