How to convert nested numbered list into JSON file using Python?

Viewed 47

Basically I need to convert this:

1
1.1
1.1.1
1.1.2
1.1.3
1.2

into this:

{
    "1": {
        "1": {
            "1": {},
            "2": {},
            "3": {}
        },
        "2": {}
    }
}

In context of this task dot is a special symbol which is used for hierarchy description only.

0 Answers
Related