Python 8 2 5 french version Still Cannot Validate (no answer in the french forum)


Oups, merci de réessayer. Votre fonction a échoué sur 1 comme entrée car votre fonction indique "global name 'reponse' is not defined" error.

def factorielle(x):
    reponse = 1
    for i in range(1, x + 1):
        reponse *= i
    return reponse


There is a bug in the submission correctness text (SCT) for this exercise. Add this to the end of your code as a workaround ...

# To pass, add this workaround
reponse = factorielle


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.