Python
De TARENTINO
Python
<syntaxhighlight > digraph G {
fontsize = "20"
subgraph cluster_0 {
label = "Installation";
style=filled;
color=lightgrey;
node [style=filled,color=white];
tbl_installation [shape=plaintext;color=white;style=filled
label=<
| INSTALLATION P23 | ||||||||||||||||||||||||||
|
>
];
}
tbl_typenonmodif [shape=plaintext;color=white;style=filled
label=<
| Manipulés par copie des valeurs | ||||||
|
||||||
| Séquences (listes ordonnées) |
>
];
tbl_typemodif [shape=plaintext;color=white;style=filled
label=<
| Manipulés par pointeurs indicables et Iterables | ||||
|
||||
| Collections (Dictionnaires) |
>
];
Chaine_caracteres [label=<
| # Chaine de caractere |
ma_chaine="Bonjour tout le monde" |
print(ma_chaine) |
>]; dictionnaires [label=<
| # dictionnaires |
Tableau (clés / éléments chaine de caractères) |
dictionnaire vide : mon_dico = { }
|
dictionnaire 1 élément : mon_dico = { 'a' : 1 }
|
dictionnaire plusieurs éléments : mon_dico = { cle : valeur, cle2 : valeur2 }
|
dictionnaire éléments différents: mon_dico = { 'un' : 1, 'deux' : 2.0, 'trois' : 3+1j }
|
>]; Nombres [label=<
| # Nombres |
Nombre entier : 42 |
Nombre réel : 3.14159 |
Nombre complexe : 4+2j |
>]; Manip_chaines [label=<
| Itérations sur chaines |
| 0 1 2 3 4 5 6 b o n j o u r -7 -6 -5 -4 -3 -2 -1 |
print(ch[2:5]) : njo |
print(ch[:-1]) : bonjou |
>]; Indicable1elem [label=<
3.06.0| Indicer un élément | |
| ma_liste=['un', 2, 3.0, 'quatre', 5, 6.0] | |
| print(ma_liste[2]) | |
| print(ma_liste[-1]) |
>]; Indicablexelem [label=<
[3.0, 'quatre', 5]['un', 2, 3.0, 'quatre', 5]| Indicer plusieurs éléments | |
| ma_liste=['un', 2, 3.0, 'quatre', 5, 6.0] | |
| print(ma_liste[2:5]) | |
| print(ma_liste[:-1]) |
>];
tbl_dico2 [shape=plaintext;color=palegreen;style=filled
label=<
| DICTIONNAIRES P52 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| Objet modifiable |
>
];
subgraph cluster_1 {
label = "Types de données";
style=filled;
b0 -> tbl_typemodif [label="OUI";color=red];
dictionnaires -> tbl_typemodif;
b0 -> tbl_typenonmodif [label="NON";color=purple];
Manip_chaines -> tbl_typenonmodif;
Chaine_caracteres -> tbl_typenonmodif;
Nombres -> tbl_typenonmodif;
Indicablexelem -> tbl_typenonmodif;
Indicable1elem -> tbl_typenonmodif;
tbl_dico2;
color=deepskyblue
subgraph cluster_1_b2 {
shape=plaintext;
tbl_typenonmodif
}
subgraph cluster_1_b3 {
shape=plaintext;
tbl_typemodif
}
}
subgraph cluster_2 {
label = "Liens";
style=filled;
color=aquamarine
tbl_liens [shape=plaintext;color=white;style=filled
label=<
| LIENS | ||||
|
>
]; }
subgraph cluster_3 {
label = "Méthodes";
style=filled;
color=yellow
tbl_methode [shape=plaintext;color=white;style=filled
label=<
| chaine.METHODE( ) | ||||||||||||||||||||||||||||||||||
|
>
]; }
Tuple_appartenance [label=<
| IN Test d'appartenance à un tuple OPERATEUR |
| Tuple3=('un', 2, "trois", 'quatre', 3+4j, 'trois') - print(" 'quatre' in tuple3:", 'quatre' in tuple3) |
>]; Liste_appartenance [label=<
| IN Test d'appartenance à une liste OPERATEUR |
| print("'un' in liste1:", 'un' in liste1) |
| print("42 in liste1:", 42 in liste1) |
>]; Tuple_nb_elem [label=<
| LEN Nombre d'éléments d'un tuple FONCTION |
| print(len(tuple3)) |
>]; Liste_nb_elem [label=<
| LEN Nombre d'éléments d'une liste FONCTION |
| print(len(ma_liste)) |
>]; Tuple_nb_occu [label=<
| COUNT Nombre d'occurences d'un Objet tuple METHODE |
| print("trois' apparait", tuple3.count('trois'), "fois") |
>]; Liste_nb_occu [label=<
| COUNT Nombre d'occurences d'un Objet liste METHODE |
| print("'quatre' apparait", liste.count('quatre'), "fois") |
>]; Tuple_index [label=<
| INDEX Première occurence d'un élément d'un Objet tuple METHODE |
| print("trois' apparait à la position:", tuple3.index('trois')) |
>]; Liste_index [label=<
| INDEX Première occurence d'un élément d'un Objet liste METHODE |
| print("trois' apparait à la position:", tuple3.index('trois')) |
>]; List_elements [label=<
| Liste (Cas no1) la modification suit |
| liste3 = [ 'un', 2, 3.0,'quatre', 3+4j ] |
| liste4 = [ 'zero', liste3, 'cinq' ] |
>]; List_inList [label=<
| Liste (Cas no2) la modification ne suit pas |
| liste3 = [ 'un', 2, 3.0 ] |
| liste4 = [ 'zero', liste3[:], 'cinq' ] |
>]; List_concat [label=<
| Concaténation d'une liste |
| liste2 = ['zero',] + liste1 + [ 'quatre', 5, 6.0] |
| print("liste2:", liste2) |
>]; List_multiplic [label=<
| Multiplier les listes |
| liste3 = liste1 * 3 |
| print("liste3:", liste3) |
>]; Liste_tri [label=<
| SORT Trier une liste METHODE |
| liste = [ 5, 4, 9, 6, 2, 1, 3, 7, 8] |
| print("Liste avant le tri", liste) |
| liste.sort() |
| print("Liste après le tri", liste) |
>];
subgraph cluster_4 {
label = "Définitions";
style=filled;
e2;
e3;
Tuple_appartenance -> e2;
Tuple_nb_elem -> e2;
Tuple_nb_occu -> e2;
Tuple_index -> e2;
List_elements -> e3;
List_inList -> e3;
Liste_nb_elem -> e3;
Liste_nb_occu -> e3;
List_concat -> e3;
List_multiplic -> e3;
Liste_appartenance -> e3;
Liste_index -> e3;
Liste_tri -> e3;
color=darkorange2
}
subgraph cluster_5 {
label = "Fonctions";
style=filled;
color=gold3
tbl_fonctions [shape=plaintext;color=white;style=filled
label=<
| FONCTIONS | ||||||||||||||||||||||||||||
|
>
]; }
tbl_Masque_chaines [shape=plaintext;color=palegreen;style=filled
label=<
| Masque chaines | |||||||||
|
>
];
tbl_dico [shape=plaintext;color=palegreen;style=filled
label=<
| DICTIONNAIRES P48 | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| Objet modifiable |
>
];
tbl_Range [shape=plaintext;color=yellow;style=filled
label=<
| range | |||||
|
>
];
tbl_Syntaxes [shape=plaintext;color=white;style=filled
label=<
| SYNTAXE | ||||||||||
|
>
];
subgraph cluster_6 {
label = "Instructions";
style=filled;
color=deeppink
tbl_Range
tbl_dico
tbl_Masque_chaines
}
subgraph cluster_7 {
style=filled;
color=maroon
tbl_operateur [shape=plaintext;color=white;style=filled
label=<
| OPERATEURS | ||||||||
|
>
]; }
subgraph cluster_8 {
style=filled;
color=RED
tbl_commentaires [shape=plaintext;color=white;style=filled
label=<
| COMMENTAIRE / AIDES | ||||||||||||
|
>
]; }
INTRODUCTION -> tbl_installation; INTRODUCTION -> b0; INTRODUCTION -> tbl_liens; INTRODUCTION -> tbl_methode; INTRODUCTION -> tbl_fonctions; INTRODUCTION -> tbl_Syntaxes; INTRODUCTION -> tbl_operateur; INTRODUCTION -> tbl_commentaires;
b0 [label="Modifiables ?"; shape="diamond";color=yellow; style=filled]; d0 [label="";color=white; style=filled]; e2 [label="Tuple ( )\nListe ordonnée d'éléments\npouvant être différents\nNon modifiable\nDe type séquence\nIndiçable\nDispose de méthodes";color=white; style=filled]; e3 [label="Liste [ ]\nListe ordonnée d'éléments\npouvant être différents\nModifiable\nDe type séquence\nIndiçable\nDispose de méthode";color=white; style=filled]; INTRODUCTION [label="Python est un langage de programmation\nmultiplateforme permettant le développement\nd'une grande variété d'applications.";shape=box;style=filled;color=cyan];
}