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

This commit is contained in:
Станислав Савиных 2025-03-06 23:28:48 +03:00
parent 00884f7e16
commit 039cfad400
3 changed files with 24 additions and 1 deletions

3
.gitignore vendored
View File

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

12
data.txt Normal file
View File

@ -0,0 +1,12 @@
13
8
11
25
1005
581
42
66
81
9
1
852

10
script.py Normal file
View File

@ -0,0 +1,10 @@
with open('data.txt', 'r') as file:
lines = file.readlines()
numbers = [int(line.strip()) for line in lines]
sorted_numbers = sorted(numbers, reverse=True)
with open('output.txt', 'w') as output_file:
for number in sorted_numbers:
output_file.write(f"{number}\n")