I am not getting this factorial function? I have managed to write the code through the hint available itself in the exercise.
But how this code works?
def factorial(x): (Defining a function)
if x == 1: (If the value is equals to one it should return the 1)
return x * factorial(x -1) (Not getting how this part works)(How it will check and multiply the number)(How it will convert as a loop because we are under if statement?)
(How it will work eg: factorial(4) will work 4*(4-1)!)
(Also not getting if there is an factorial function or not in the python because when running the factorial in python then it replies as factorial in not defined)