1 changed files with 15 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||
|
def manque(joueur): |
||||
|
"""Calcule le nombre d'actions manquées par un joueur.""" |
||||
|
echecs = 0 |
||||
|
|
||||
|
with open("stats.txt", "r") as fichier: |
||||
|
for ligne in fichier: |
||||
|
data = ligne.split() |
||||
|
if data[0] == joueur and ("tir-manque" in data[1] or "lancer-rat" in data[1] or "perteBalle" in data[1]): |
||||
|
echecs += 1 |
||||
|
|
||||
|
return echecs |
||||
|
|
||||
|
# Test |
||||
|
if __name__ == "__main__": |
||||
|
print(manque("J1")) |
Loading…
Reference in new issue