Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

5 changed files with 31 additions and 2 deletions

2
.gitignore vendored Normal file
View File

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

View File

@ -1,2 +1 @@
# py_repo
Задание: считать данные из файла data.txt, провести сортировку чисел по убыванию

12
data.txt Normal file
View File

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

6
requirements.txt Normal file
View File

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

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")