Compare commits
No commits in common. "main" and "master" have entirely different histories.
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.venv/
|
||||
output.txt
|
@ -1,2 +1 @@
|
||||
# py_repo
|
||||
|
||||
Задание: считать данные из файла data.txt, провести сортировку чисел по убыванию
|
6
requirements.txt
Normal file
6
requirements.txt
Normal 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
10
script.py
Normal 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")
|
Loading…
Reference in New Issue
Block a user