python
intermediate
已解决
2026-11-17 结束
Flatten nested settings
Config files are often nested. Write flatten(d) that turns nested dicts into one level, joining keys with dots:
flatten({"db": {"host": "x", "port": 5432}, "debug": True})
# {"db.host": "x", "db.port": 5432, "debug": True}
- Only dicts are flattened; lists and other values are kept as they are.
- An empty nested dict disappears.
目前已有 0 人解出。
编辑器Ctrl + Enter
当测试输出 "All tests passed" 时,此挑战会在本浏览器中标记为已解决。
提交您的解决方案进行审核