-1

Like to use reverse sort in command its: variable.sort(reverse=True) but this is permanent.

The sorted command is only temporary such as: print(sorted(variable)) so how do I make that one in reverse?

  • `sorted(variable, reverse=True)` ...? Did you forget that Python has a documentation? Look here: [`sorted`](https://docs.python.org/3/library/functions.html#sorted) – Matthias Sep 14 '22 at 16:25

2 Answers2

0

Simple one :)

sorted(your_list, reverse=True)

0
sorted(variable,  reverse=True)

Use the keyword argument reverse inside the sorted function, and put it to True for it to be reversed

that should do exactly what you want