I have an assignment to take a number and to sort it in a ascending and descending order and then add it together to get a result. I know how to get the number sorted in a ascending order but not descending. For my code I have:
def addition(num):
listedDes = list(str(num))
listedDes.sort()
print("".join(listedDes))
addition(3524)