My code is successful with no error messages, but I wanted to print out my 'result' variable at the end, as well as return it.
However adding the 'print result' line into my code (as shown) did not achieve this. Anyone know why not? Thanks.
P.S. I have also tried printing 'result' outside of the for loop, did not work.
x = raw_input("Please input a number: ") def factorial(x): result = 1 for i in range(0, x): result = result * (i + 1) print result return result