Function Name:
reversed
Function Signature:
reversed(dictionaryViewObject)
Overview:
- The method returns a new dictionary view object with members of the dictionary view arranged in reverse order.
Return Value:
A dictionary view object - An object of type dict_keys, dict_items or dict_values
Example:
# Example python program that reverses a dictionary view # Get the dictionary view of type dict_items # Reverse the arrangement # Print the elements from the reversed view |
Output:
Dictionary view in reverse order: ('Astatine', 85) ('Iodine', 53) ('Bromine', 35) ('Chlorine', 17) ('Fluorine', 9) |