input: Write a function to invert a dictionary, where the keys become values and the values become keys in a list.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1})=={1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'apple': 'fruit', 'carrot': 'vegetable'})=={'fruit': ['apple'], 'vegetable': ['carrot']}
  assert invert_dictionary({})=={}
  assert invert_dictionary({'one': 1, 'two': 2, 'three': 3})=={1: ['one'], 2: ['two'], 3: ['three']}
output: def invert_dictionary(d):
      result = {}
      for key, value in d.items():
          if value in result:
              result[value].append(key)
          else:
              result[value] = [key]
      return result