input: Write a function that takes a dictionary as an argument and returns an inverted dictionary where the keys are the original dictionary's values and the values are lists of the original dictionary's keys. If the same value appears multiple times in the original dictionary, its corresponding key should be added to the list of keys in the inverted dictionary. If the input dictionary is empty, the function should return an empty dictionary.
  
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2})=={1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({'x': 'apple', 'y': 'banana', 'z': 'apple'})=={'apple': ['x', 'z'], 'banana': ['y']}
  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