From e81c34cf368ff1166c3743f2e035ff3c4244fbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A2?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D0=BA=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sat, 15 Mar 2025 13:23:30 +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 --- .gitignore | 2 ++ README.md | 1 + data.txt | 1 + requirements.txt | 0 script.py | 12 ++++++++++++ 5 files changed, 16 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 data.txt create mode 100644 requirements.txt create mode 100644 script.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbf15aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.venv +/output.txt \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..051cc86 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ + README.md diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..691bb34 --- /dev/null +++ b/data.txt @@ -0,0 +1 @@ +всем привет \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/script.py b/script.py new file mode 100644 index 0000000..0e6d7c5 --- /dev/null +++ b/script.py @@ -0,0 +1,12 @@ +# Читаем данные из файла data.txt +with open("data.txt", "r", encoding="utf-8") as file: + lines = file.readlines() + +# Преобразуем строки в верхний регистр +transformed_lines = [line.strip().upper() for line in lines] + +# Записываем обработанные данные в output.txt +with open("output.txt", "w", encoding="utf-8") as file: + file.write("\n".join(transformed_lines)) + +print("Файл output.txt успешно создан.") \ No newline at end of file