input: Write a function to invert a dictionary where each value becomes a key and the corresponding keys are collected into a list as values. If the given dictionary is empty then return an empty dictionary.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2})=={1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({'x': 'y', 'z': 'y'})=={'y': ['x', 'z']}
  assert invert_dictionary({})=={}
output: def invert_dictionary(d):
      inverted = {}
      for key, value in d.items():
          if value in inverted:
              inverted[value].append(key)
          else:
              inverted[value] = [key]
      return inverted