
Implement invert_groups, which returns a new dict mapping each value of mapping to the list of keys that had it.
invert_groups({"kiwi": 3, "fig": 5, "pear": 3}){3: ['kiwi', 'pear'], 5: ['fig']}invert_groups({"owl": 9, "bat": 2, "elk": 9, "ant": 2}){9: ['owl', 'elk'], 2: ['bat', 'ant']}invert_groups({}){}invert_groups.py
Run the tests to grade your code
Implement invert_groups, which returns a new dict mapping each value of mapping to the list of keys that had it.
invert_groups({"kiwi": 3, "fig": 5, "pear": 3}){3: ['kiwi', 'pear'], 5: ['fig']}invert_groups({"owl": 9, "bat": 2, "elk": 9, "ant": 2}){9: ['owl', 'elk'], 2: ['bat', 'ant']}invert_groups({}){}invert_groups.py
Run the tests to grade your code
Variables will appear here