Time:10-28
CodePudding user response:
do you want to use is the sort of? The sort and sorted, and
sort and sorted the usage of different, You sorted usage in line 4 is right But the sort of usage is the list. The sort () Such as: travel. Sort () Sort is directly changing the order of the list itself, and sorted is returns a sorted list will not change the order of the original list
Quote: refer to the third floor smiled program monkey reply: sort and sorted the usage of different, You sorted usage in line 4 is right But the sort of usage is the list. The sort () Such as: travel. Sort () Sort is directly changing the order of the list itself, and sorted is returns a sorted list will not change the order of the original list How do I call for a travel list sorted (reverse=True) function? Code should be how to write?
Reverse_travel=sorted (travel, reverse=True)
Quote: python beginners reference 4 floor of the self-taught reply: Quote: refer to the third floor smiled program monkey reply: sort and sorted the usage of different, You sorted usage in line 4 is right But the sort of usage is the list. The sort () Such as: travel. Sort () Sort is directly changing the order of the list itself, and sorted is returns a sorted list will not change the order of the original list How do I call for a travel list sorted (reverse=True) function? Code should be how to write? Reverse_travel=sorted (travel, reverse=True)
Page link:https//www.codepudding.com/other/73569.html