input: Write a function that takes a dictionary as an argument and returns an inverted dictionary. The inverted dictionary should have keys from the original dictionary's values, and the corresponding value should be a list of keys from the original dictionary that map to that value. If the dictionary is empty, return an empty dictionary.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2})=={1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({'x': 'apple', 'y': 'apple', 'z': 'banana'})=={'apple': ['x', 'y'], 'banana': ['z']}
  assert invert_dictionary({'p': True, 'q': True, 'r': False})=={True: ['p', 'q'], False: ['r']}
  assert invert_dictionary({})=={}
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