diff --git a/manque.py b/manque.py index 5393282..10711df 100644 --- a/manque.py +++ b/manque.py @@ -1,3 +1,21 @@ from traitement import traitement def manque(joueur): - tb1 = traitement("stats.txt") \ No newline at end of file + tb1 = traitement("stats.txt") + lst_joueur = tb1[0] + lst_action = tb1[1] + perte_de_balle = 0 + tir_manque = 0 + lancer_rat = 0 + total_manque = 0 + for i in range(len(lst_joueur)): + if str(joueur) == str(lst_joueur[i]): + action = lst_action[i] + if action == "tir-manque": + tir_manque = tir_manque +1 + if action == "lancer-rat": + lancer_rat = lancer_rat + 1 + if action == "perteBalle": + perte_de_balle = perte_de_balle +1 + total_manque = tir_manque + lancer_rat + perte_de_balle + print(total_manque) + diff --git a/rebondsPasse.py b/rebondsPasse.py new file mode 100644 index 0000000..03c8c2a --- /dev/null +++ b/rebondsPasse.py @@ -0,0 +1,19 @@ +from traitement import traitement +def rebondPasses(joueur): + tb1 = traitement ("stats") + lst_joueur = tb1[0] + lst_action = tb1[1] + passe = 0 + rebondOff = 0 + rebondDef = 0 + for i in range(len(lst_joueur)): + if str(joueur) == str(lst_joueur[i]): + action = lst_action[i] + if action == "passe": + passe = passe +1 + if action == "rebondOff": + rebondOff = rebondOff + 1 + if action == "rebondDef": + rebondDef = rebondDef +1 + return("Passe:",passe,"RebondOff:",rebondOff,"rebondDef:",rebondDef) + \ No newline at end of file