Добавлены файлы data.txt, script.py

This commit is contained in:
Николай Перминов 2025-05-17 03:03:24 +03:00
parent 2bf892964e
commit e3b9d90556
4 changed files with 14 additions and 1 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
.venv/
.venv/
output.txt

4
data.txt Normal file
View File

@ -0,0 +1,4 @@
hello
world
python
123

BIN
requirements.txt Normal file

Binary file not shown.

8
script.py Normal file
View File

@ -0,0 +1,8 @@
with open('data.txt', 'r') as file:
lines = file.readlines()
transformed_lines = [line.strip().upper() for line in lines]
with open('output.txt', 'w') as file:
for line in transformed_lines:
file.write(line + '\n')
print("Данные успешно обработаны и сохранены в output.txt")