score = {40:"x",30:"y",50:"z",45:"a"}
print(sorted(score).reverse())
it is because reverse() doesnt return the reversed list , it modifies the existing list,try this instead
score = {40:"x",30:"y",50:"z",45:"a"}
sorted_score= sorted(score)
sorted_score.reverse()
print(sorted_score)