Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révisionLes deux révisions suivantes | ||
python:bases:listes [2024/02/29 08:08] – [9. Liste de listes (tableaux à plusieurs dimensions)] phil | python:bases:listes [2024/02/29 08:18] – [9. Liste de listes (tableaux à plusieurs dimensions)] phil | ||
---|---|---|---|
Ligne 290: | Ligne 290: | ||
* **Construction par compréhension** | * **Construction par compréhension** | ||
<code python *.py> | <code python *.py> | ||
+ | # Tableau 3 x 5 | ||
t = [[0]*5 for i in range(3)] | t = [[0]*5 for i in range(3)] | ||
</ | </ | ||
- | {{ : | + | {{ : |
+ | <callout type=" | ||
* **Accès à un élément** | * **Accès à un élément** | ||
<code python *.py> | <code python *.py> | ||
a = t[2][1] # renvoi 2 | a = t[2][1] # renvoi 2 | ||
- | </ | ||
- | |||
- | * **Construction par compréhension** | ||
- | <code python *.py> | ||
- | # Tableau 3 x 5 | ||
- | t = [[0]*5 for i in range(3)] | ||
</ | </ | ||