File Owners

Python Language Public



Implement a group_by_owners function that:

  • Accepts a dictionary containing the file owner name for each file name.
  • Returns a dictionary containing a list of file names for each owner name, in any order.

For example, for dictionary {'Input.txt': 'Randy', '': 'Stan', 'Output.txt': 'Randy'} the group_by_owners function should return {'Randy': ['Input.txt', 'Output.txt'], 'Stan': ['']}.

Python 3.6.2

  •   Example case: Wrong answer
  •   Each owner has a single file: Wrong answer
  •   Various files: Wrong answer