From b4c5fbe47a54dbf88c2b9f7355781166e740a319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BC=D0=B0=D0=B5=D0=B2=20=D0=90=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20=D0=9D=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sat, 23 May 2026 20:44:22 +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 | 3 ++- data.txt | 4 ++++ requirements.txt | Bin 0 -> 178 bytes script.py | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 data.txt create mode 100644 requirements.txt create mode 100644 script.py diff --git a/.gitignore b/.gitignore index 0cafc1c..c136cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.venv/ \ No newline at end of file +.venv/ +output.txt \ No newline at end of file diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..99a9952 --- /dev/null +++ b/data.txt @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..0b17645c74d593335044600bba40e4fbe41a3219 GIT binary patch literal 178 zcmX|*TMC0P6b0v7a4AYO#nKNKBUn)I1xca0c zJqh7>me4;y%fmKdnR^+X=$jEfJy;5eA7sQ-pgPgB9m3YO|tpCo)k-ECn L;q8eZCsr literal 0 HcmV?d00001 diff --git a/script.py b/script.py new file mode 100644 index 0000000..5caff65 --- /dev/null +++ b/script.py @@ -0,0 +1,19 @@ +# script.py + +def main(): + # 1. Открываем файл data.txt и считываем данные + with open("data.txt", "r", encoding="ANSI") as f: + lines = f.readlines() + + # 2. Преобразуем все строки в верхний регистр + upper_lines = [line.strip().upper() + "\n" for line in lines] + + # 3. Записываем результат в новый файл output.txt + with open("output.txt", "w", encoding="ANSI") as f: + f.writelines(upper_lines) + + print("Файл output.txt успешно создан.") + + +if __name__ == "__main__": + main() \ No newline at end of file