def max_value(d):
    """ Takes a dictionary d and returns the maximum element value and its
        corresponding key. Raises a TypeError if any of the values are not
        comparable to each other.

        >>> max_value({'a': 12, 3: 45})
        (3, 45)
        >>> max_value({}) is None
        True
        >>> max_value({33: 34, -1: 600, 'xyz': 2000.4})
        ('xyz', 2000.4)
        >>> max_value({1: 'abc', 2: 'xyz', 3: 'ghijkl'})
        (2, 'xyz')
        >>> max_value({1:'a', 2:3}) # doctest:+ELLIPSIS
        Traceback (most recent call last):
            ...
        TypeError:...
    """
    # Hint: d.values() is a sequence of all the values in dictionary d
    #       try using this along with built-in function max

    if d == {}:                 # if empty, return None
        return None
    max_key = ''                # initialize max_key as ''
    max_val = max(d.values())   # set max_val to the max of all values in d
    for key in d.keys():        # iterate over all keys in d
        if d[key] >= max_val:
            max_val = d[key]    # set d[key] to max_val if it's the highest that's been iterated over
            max_key = key       # assign max_key when max_val is assigned 
    return (max_key, max_val)