Clarification: the original answer is given below. As noted, the question lies in the chain as a whole, and not in any particular case. A clarification of this can be found at the end of this answer.
You can spell it right straight.
a = [2,3,1]
b = sorted(a, reverse=True)
Even if you want to use only methods, you can do it quite simply:
a = [2,3,1]
b = a.copy()
b.sort(reverse=True)
Python . , . python , , ( ) . , .
python. , , ( ).
, .
foo = they.method.method.method()
foo = my_func(your_func(their_func()))
[2,3,1].sort().reverse(). :
a = [2,3,1]
b = a.sort()
c = b.reverse()
s.sort() None, None.reverse() - None.
. , - . ,
s = "ab:cd".upper().center(20).partition(':')
print(s)
(' AB', ':', 'CD ').