(d, n_tab=-1)
| 4 | |
| 5 | |
| 6 | def list_dictionary(d, n_tab=-1): |
| 7 | if isinstance(d, list): |
| 8 | for i in d: |
| 9 | list_dictionary(i, n_tab) |
| 10 | elif isinstance(d, dict): |
| 11 | n_tab += 1 |
| 12 | for key, value in d.items(): |
| 13 | if key == '<end>': |
| 14 | print("{}{}".format(" " * n_tab, key)) |
| 15 | else: |
| 16 | print("{}{}".format(" " * n_tab, key)) |
| 17 | list_dictionary(value, n_tab) |
| 18 | else: |
| 19 | print("{}{}".format("\t" * n_tab, d)) |
| 20 | |
| 21 | |
| 22 | def print_tree(tree): |