Browse Source

ajout

master
enora.delmas 3 weeks ago
parent
commit
6983011e4f
  1. 18
      fonction_reussite.py

18
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]
Loading…
Cancel
Save