eduroam-prg-hf-1-5-62.net.univ-paris-diderot.fr 2025-9-29:13:20:41
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
---
|
---
|
||||||
description: |
|
up: [[python tips]]
|
||||||
|
link: "https://gist.github.com/hrldcpr/2012250"
|
||||||
|
author: [[harold cooper]]
|
||||||
|
tags:
|
||||||
|
- "#s/informatique/langage/python"
|
||||||
|
---
|
||||||
|
|
||||||
|
Permet de définir la structure d'[[structure de données.arbre]] de manière simple, grace aux `defaultdicts` (module collections)
|
||||||
|
|
||||||
|
# Résumé
|
||||||
```python
|
```python
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
@@ -18,17 +27,6 @@ description: |
|
|||||||
add_path(example, "B>B.2>B.2.2".split(">"))
|
add_path(example, "B>B.2>B.2.2".split(">"))
|
||||||
pprint(tree_to_dicts(example))
|
pprint(tree_to_dicts(example))
|
||||||
```
|
```
|
||||||
---
|
|
||||||
up::[[python tips]]
|
|
||||||
link::https://gist.github.com/hrldcpr/2012250
|
|
||||||
author::[[harold cooper]]
|
|
||||||
title::"definir des [[structure de données.arbre|arbres]] avec les defaultdicts du module [[python module collections]]"
|
|
||||||
|
|
||||||
#s/informatique/langage/python
|
|
||||||
|
|
||||||
----
|
|
||||||
Permet de définir la structure d'[[structure de données.arbre]] de manière simple, grace aux `defaultdicts` (module collections)
|
|
||||||
|
|
||||||
|
|
||||||
# Définition
|
# Définition
|
||||||
```python
|
```python
|
||||||
|
Reference in New Issue
Block a user