input: Write a function to take a dictionary as an argument and return an inverted dictionary where the keys and values are swapped. If the original dictionary has multiple keys with the same value, the inverted dictionary will have the value as a key and a list of the original keys as its value.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 3})=={1: ['a'], 2: ['b'], 3: ['c']}
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2})=={1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({})=={}
  assert invert_dictionary({'x': 'y', 'z': 'y'})=='y': ['x', 'z']
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