input: Write a function to invert a given dictionary where the values become keys and the keys become values. If a value appears multiple times in the original dictionary, the new key should map to a list of corresponding original keys.
  def invert_dictionary(d):
      inverted_d = {}
      for key, value in d.items():
          if value not in inverted_d:
              inverted_d[value] = []
          inverted_d[value].append(key)
      return inverted_d
  
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1})=={1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'x': 'apple', 'y': 'banana', 'z': 'apple'})=={'apple': ['x', 'z'], 'banana': ['y']}
  assert invert_dictionary({'w': 3, 'v': 3, 'u': 2})=={3: ['w', 'v'], 2: ['u']}
  assert invert_dictionary({})=={}
output: def invert_dictionary(d):
      inverted_d = {}
      for key, value in d.items():
          if value not in inverted_d:
              inverted_d[value] = []
          inverted_d[value].append(key)
      return inverted_d