DAS_2023_1/basharin_sevastyan_lab_2/app2/main.py
2023-11-21 21:21:04 +04:00

14 lines
433 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()