sorting list python

Smith smith at smith.it
Wed Jan 18 15:35:21 EST 2017


On 18/01/2017 21:20, Peter Otten wrote:
> with open("partite.txt") as f:
>     by_number = sorted(f, key=lambda line: int(line.partition("'")[0]))
>     print("".join(by_number))


Great!!! :-)


More information about the Python-list mailing list