Print a Directory Tree

medium
Unit 17 · Data Structures & Recursion0/3 to milestone

Render a nested dict as a tree-style listing. Directories are dicts (name → children), files map to None. Implement render_tree(name, node) returning a string:

project
├── README.md
└── src
    ├── app.py
    └── utils
        └── io.py

Within a directory, list subdirectories first, then files, each group sorted alphabetically. Use ├── / └── connectors and │ / for indentation.

#recursion#formatting2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Print a Directory Tree · TechGradify