input: Write a function to invert a dictionary where each key-value pair is swapped and if there are multiple keys with the same value, the corresponding value in the inverted dictionary will be a list of those 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({'a': 'apple', 'b': 'banana', 'c': 'apple', 'd': 'durian'})=={'apple': ['a', 'c'], 'banana': ['b'], 'durian': ['d']}
  assert invert_dictionary({'x': 5, 'y': 5, 'z': 5})=={5: ['x', 'y', 'z']}
  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