# Définition d'une liste a = [1, 2, 3] print a # [1, 2, 3] #Concaténation avec une valeur a.extend([8/2]) print a #[1, 2, 3, 4] #Concaténation avec une liste a.extend([[ 5, 7]]) print a #[1, 2, 3, 4, [5, 7]] #Concaténation avec une index d'insertion a[4].extend([[7]]) print a #[1, 2, 3, 4, [5, 7, [7]]] |
Livres Sur ce Sujet
Apprendre à programmer avec Python 3 Apprenez à programmer en Python Python : Petit guide à l’usage du développeur agile Apprendre à programmer avec Python 3 : Avec plus de 50 pages de corigés d’exercices !