Добавлены файлы 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
+2 -1
View File
@@ -1 +1,2 @@
.venv/ .venv/
output.txt
+4
View File
@@ -0,0 +1,4 @@
hello
world
python
123
BIN
View File
Binary file not shown.
+8
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")