0
in Eat.txt there is the following content:
02:26:31 14:44:45 09:53:27
14:17:35 12:33:44 09:30:12
I’m reversing the order of the elements ad following way:
import sys
with open 'eat.txt as f:
lines = f.read().strip().splitlines()
for line in lines:
out = ' '.join(sorted(line.split(), reverse=True))
print(out)
Exit:
14:44:45 09:53:27 02:26:31
14:17:35 12:33:44 09:30:12
Why does he just switch the first line and the second no?
Simple: because the second line is already ordered in reverse order. :)
– Luiz Vieira