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

This commit is contained in:
Вера Виноградова 2025-03-18 19:52:07 +03:00
parent 8b05545c42
commit 9501ee882d
5 changed files with 20 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
.venv/

2
data.txt Normal file
View File

@ -0,0 +1,2 @@
Вода 3
Лимонад 2

2
output.txt Normal file
View File

@ -0,0 +1,2 @@
ВОДА 3
ЛИМОНАД 2

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
numpy==2.2.4
pandas==2.2.3
python-dateutil==2.9.0.post0
pytz==2025.1
six==1.17.0
tzdata==2025.1

9
script.py Normal file
View File

@ -0,0 +1,9 @@
with open('data.txt', 'r', encoding='utf-8') as file:
lines = file.readlines()
upper_lines = [line.upper() for line in lines]
with open('output.txt', 'w', encoding='utf-8') as file:
file.writelines(upper_lines)
print("Файл output.txt успешно создан.")