I'm attempting to compose a basic factorial function in Python, yet upon execution, this one only sits idle and intrinsically crashes the console for some unusual explanation.
Kindly remember that I just started coding with Python about seven days prior, and am accustomed to utilizing other lower-level OOP languages, so kindly pardon any undeniable slip-ups.
Look at my current function:
# initialise factorial function:
i = 1 # initialise incrementing variable
while i < n:
n = n * i
i = i + 1
return n # return result
Here, The function prints nothing. Kindly help me.