From 846606139f212f75fc2d70e29ef7dcf3d6d0a5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Sat, 23 May 2026 20:08:32 +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 | 5 +++++ script.py | 9 +++++++++ 2 files changed, 14 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..35bbedc --- /dev/null +++ b/data.txt @@ -0,0 +1,5 @@ +Молоко 2 +Хлеб 1 +Яблоки 4 +Сыр 3 +Чай 5 \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..c9ab915 --- /dev/null +++ b/script.py @@ -0,0 +1,9 @@ +with open("data.txt", "r", encoding="utf-8") as file: + lines = file.readlines() + +changed_lines = [line.upper() for line in lines] + +with open("output.txt", "w", encoding="utf-8") as file: + file.writelines(changed_lines) + +print("Файл output.txt создан.") \ No newline at end of file