求教python将一个正整数各位数字按从大到小排序输出一个新数字

求教python将一个正整数各位数字按从大到小排序输出一个新数字

问题描述:

 

n = input()
n = sorted(list(n),reverse=True)
print(int(''.join(n)))