Добавлены файлы data.txt, script.py
This commit is contained in:
@@ -1 +1,2 @@
|
||||
.venv/
|
||||
output.txt
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
with open('data.txt','r') as file:
|
||||
lines = file.readlines()
|
||||
sorted_lines = []
|
||||
for line in lines:
|
||||
sorted_line=' '.join(sorted(line.split(), key=int))
|
||||
sorted_lines.append(sorted_line)
|
||||
|
||||
with open('output.txt', 'w') as file:
|
||||
for sorted_line in sorted_lines:
|
||||
file.write(sorted_line + '\n')
|
||||
|
||||
Reference in New Issue
Block a user