Is_factorial (HELP!)


#1



Help me, please. I don't understand why this code doesn't work!


It shows me an error window:

"Something went wrong :frowning:
Click Close to try again or refresh the page."

And it doesn't help.


def factorial(x):
    result = 1
    while х > 0:
        result *= x
        х -= 1
    return result


#2

one of the characters you use is not valid. i typed your code again:

def factorial(x):
    result = 1
    while x > 0:
        result *= x
        x -= 1
    return result

and its fine

you could try to pinpoint the problem, but its tricky.


#3

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