Fill in the line of the following Python code for calculating the factorial of a number. def fact(num): if num == 0: return 1 else: return code example
Example: python calculate factorial
def factorial(n):
fact = 1
for num in range(2, n + 1):
fact = fact * num
return(fact)