Processing math: 100%

Problem 2: Factorial (100pts)

Write a function that takes a positive integer n and returns its factorial.

Factorial of a positive integer n is defined as

n!=ni=1i=1×2×3××n.

def factorial(n): """Return the factorial of a positive integer n. >>> factorial(3) 6 >>> factorial(5) 120 """ "*** YOUR CODE HERE ***"

Test your implementation with python ok -q factorial.