python reverse dict key order
# Python3 using reversed() + items()
test_dict = {'Hello' : 4, 'to' : 2, 'you' : 5}
rev_dict = dict(reversed(list(test_dict.items()))) # Reversing the dictionary
print("The original dictionary : " + str(test_dict))
print("The reversed order dictionary : " + str(rev_dict))
# Output:
"The original dictionary : {'Hello': 4, 'to': 2, 'you': 5}"
"The reversed order dictionary : {'you': 5, 'to': 2, 'Hello': 4}"