From 94df79bcdd29be1bdc6e34739cf2156660612796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D1=8E=D1=80=D0=BD=D0=B8=D0=BD=20=D0=9A=D0=B8=D1=80?= =?UTF-8?q?=D0=B8=D0=BB=D0=BB?= Date: Tue, 4 Mar 2025 21:47:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20data.txt,=20scr?= =?UTF-8?q?ipt.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data.txt | 6 ++++++ script.py | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 data.txt create mode 100644 script.py diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..bf1420d --- /dev/null +++ b/data.txt @@ -0,0 +1,6 @@ +сосиски +молоко +майонез +огурцы +помидоры +хлеб \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..aa7be84 --- /dev/null +++ b/script.py @@ -0,0 +1,12 @@ +# script.py + +with open('data.txt', 'r', encoding='utf-8') as file: + lines = file.readlines() + +uppercase_lines = [line.strip().upper() for line in lines] + +with open('output.txt', 'w', encoding='utf-8') as output_file: + for line in uppercase_lines: + output_file.write(line + '\n') + +print("Данные успешно записаны в output.txt")