input: Write a function that takes a dictionary as an argument and returns an inverted dictionary where the keys are the values of the original dictionary and the values are lists of keys from the original dictionary that had the same value.
  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': 3, 'y': 4, 'z': 3})=={3: ['x', 'z'], 4: ['y']}
  assert invert_dictionary({})=={}
  assert invert_dictionary({'q': 5})=={5: ['q']}
  assert invert_dictionary({'m': 6, 'n': 7, 'o': 6, 'p': 8})=={6: ['m', 'o'], 7: ['n'], 8: ['p']}
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