Outils pour utilisateurs

Outils du site


python:programmes:sort_array

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
python:programmes:sort_array [2014/02/21 23:23] – créée rootpython:programmes:sort_array [2014/02/21 23:34] (Version actuelle) root
Ligne 1: Ligne 1:
 ====== Trier un tableau ====== ====== Trier un tableau ======
  
 +Tous les exemples : https://wiki.python.org/moin/HowTo/Sorting
 <code python> <code python>
 >>> Lf = ['ACBD', 'AABB', 'ABBB','ACBD','ACBD','ABBB'] >>> Lf = ['ACBD', 'AABB', 'ABBB','ACBD','ACBD','ABBB']
Ligne 11: Ligne 12:
  
 Trier par indices : Trier par indices :
-<code>+<code python>
 >>> print Lt >>> print Lt
 [('AAAB', 1), ('AABB', 3), ('ABBB', 2), ('ACBD', 6)] [('AAAB', 1), ('AABB', 3), ('ABBB', 2), ('ACBD', 6)]
Ligne 20: Ligne 21:
  
 Eliminer les doublons : Eliminer les doublons :
-<code>+<code python>
 >>> Lf = ['ACBD', 'AABB', 'ABBB','ACBD','ACBD','ABBB'] >>> Lf = ['ACBD', 'AABB', 'ABBB','ACBD','ACBD','ABBB']
 >>> Li = ['ACBD', 'AAAB', 'AABB','ACBD','ACBD','AABB'] >>> Li = ['ACBD', 'AAAB', 'AABB','ACBD','ACBD','AABB']
python/programmes/sort_array.1393025015.txt.gz · Dernière modification : 2014/02/21 23:23 de root