Notes:
- Use operator module in python.
- Define two different functions
- One to get ascending order of dict
- Two to get descending order of dict.
Instructions:
-
Program should be written in file build.py
-
Function names should be solution_asc and solution_desc for ascending and descending sorts respectively.
-
Input
Type: Dictionary Value: {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}
-
Expected Output
Type: List Value: In ascending order it should be: [(0, 0), (1, 2), (2, 1), (3, 4), (4, 3)] In descending order it should be: [(4, 3), (3, 4), (2, 1), (1, 2), (0, 0)]