Define a function that takes a dictionary as a parameter and iterates over its key:value pairs. The Function should return a sorted list containing tuples of the key-value pairs.
Example:
Input:
{1: 10, 2: 20, 3: 30, 4: 40}
Output:
[(1, 10), (2, 20), (3, 30), (4, 40)]