1 changed files with 18 additions and 0 deletions
@ -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] |
||||
|
|
Loading…
Reference in new issue