Use pathlib to extract name, suffix, parent, and stem from file paths.
Constraints
Example
>>> analyze_path("/home/user/docs/report.txt")
{'name': 'report.txt', 'stem': 'report', 'suffix': '.txt', 'parent': '/home/user/docs'}
>>> analyze_path("archive.tar.gz")
{'name': 'archive.tar.gz', 'stem': 'archive.tar', 'suffix': '.gz', 'parent': '.'}
>>> analyze_path("folder/")
{'name': 'folder', 'stem': 'folder', 'suffix': '', 'parent': '.'}
>>> analyze_path("/")
{'name': '/', 'stem': '/', 'suffix': '', 'parent': '/'}
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints