input: Write a function that takes a dictionary as an argument and returns an inverted dictionary where the keys and values are swapped. If the original dictionary has duplicate values, the inverted dictionary should have lists of keys for those values.
  
  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'}) == {'apple': ['a', 'c'], 'banana': ['b']}
  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