current position:Home>[Python] sort and sorted

[Python] sort and sorted

2022-05-15 05:57:23__ Watson__

sort() yes list The way to go , Yes list Self modification
ls = []
ls Itself is changed

sorted() yes Python Built in sorting method , Return another sorted result , Do not change the original data ,sorted The content is not just list, It can also be other iteratable objects .

copyright notice
author[__ Watson__],Please bring the original link to reprint, thank you.

Random recommended