Need Help please
Hi Guys, I need some help with this code. I debugged most of it but it still gives me a hard time with the return result statement error Python: SyntaxError 'return' outside function error can someone explain please exactly what the error means so I can fix it. Im new to python and im still struggling with the basics.If somebody could explain in layman terms would be great. def factorial(n): """Calculate the factorial of the given value and return the result. The factorial of n is the product of all positive integers less than or equal to n. Keyword arguments: n -- A positive integer """ result = 1 while n != 0: n = n - 1 result = result * n return result #Calculate factorial for the first four integers. for i in range(-1, 7): print('Factorial of', i, 'is', factorial(i))