diff --git a/fonction_reussite.py b/fonction_reussite.py new file mode 100644 index 0000000..fda2879 --- /dev/null +++ b/fonction_reussite.py @@ -0,0 +1,18 @@ +def reussite(joueur, action): + with open('stats.txt', 'r') as f: + lst_joueur = [] + lst_action = [] + for ligne in f: + ligne = ligne.strip() + lst_element = ligne.split(' ') + nom_joueur = lst_element[0] + nom_action = lst_element[1] + lst_joueur.append(nom_joueur) + lst_action.append(nom_action) + i = -1 + lst_action_joueur = [] + for nom in lst_joueur: + i = i+1 + if nom == joueur: + action_joueur = lst_action[i] + \ No newline at end of file