Добавлены файлы data.txt, script.py
This commit is contained in:
parent
f358e5d2a8
commit
10c3374059
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.venv/
|
.venv/
|
||||||
|
output.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
|
11
script.py
Normal file
11
script.py
Normal file
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user