Retour aux quiz
Débutant
Inspection de signature avec co_argcount
Que contient la liste après ces opérations ?
quiz.py
1
def func(a, b):2
return a + b3
print(func.__code__.co_argcount)Réponses possibles
A2
B3
C1
DErreur
Explication
co_argcount retourne le nombre d'arguments attendus par la fonction (a et b, donc 2).