Bonjour a toutes et a tous ,

Dabord le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def pluralize(total,singular,plural=None):
    assert isinstance(total,int) and total >= 0,'Entrez un entier positif'
    if not plural:
        plural = singular + 's'
    string = singular if total <=1 else plural
    return f'{total} {string}'
 
def affichage(team,wins,losses):
    return f"[Resultat Sportif]: Equipe {team}: {pluralize(wins,'victoire')} - {pluralize(losses,'defaite')}"
 
with open('fichier_equipe.txt') as file:
    data = file.readline().strip().split('/')
 
print(affichage(data[0],int(data[1]),int(data[2]))
Lorsque j'appelle affichage , int précède data[1] et data[2] pour m'assurer que l'utilisateur rentre bien un entier, pourtant dans ma fonction pluralize j'ai " assert isinstance(total,int) "qui joue le meme role , non ?
Je ne comprends pas bien , pouvez vous m'éclairer ?
Merci de votre aide .