Octal number problem
t.evans at paradise.net.nz
Sat Feb 22 04:44:41 CET 2003
Gary Duncan <gmduncan at netspace.net.au> writes:
> I have a list of 5-digit decimal numbers, which was constructed
> with leading zeroes where necessary so that the list is sorted by magnitude
> using Unix 'sort' (otherwise '00200' would appear before '1').
Slightly off-topic, but (at least when using gnu sort) 'sort -n' can
$ printf '100\n2' | sort
$ printf '100\n2' | sort -n
The '-n' switch sorts the lines as decimal numbers.
More information about the Python-list