How do you sort a list temporarily?
The sorted() function returns a copy of a list in a natural sorted order. The order of the original list isn't affected.
How do you sort a list permanently?
To sort a list, use the sort() method.
The sorted() function returns a copy of a list in a natural sorted order. The order of the original list isn't affected.
To sort a list, use the sort() method.