Добавлены файлы data.txt, script.py
This commit is contained in:
parent
00884f7e16
commit
039cfad400
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.venv/
|
||||
output.txt
|
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