A factorial is a number that has been multiplied by each number preceding it. In this exercise, use recursion to get the factorial of any given number. A recursive function is one that calls itself conditionally, for example a function that takes a number, prints it out, then calls itself with func_name(parameter_name - 1) to restart the process using a number one lower. Combine this with an if statement to avoid a recursion error, and you have a basic recursive function. Use this concept to find the factorial of any given number.
def factorial(n):
# your code goes here
return
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(factorial(5), 120)
test.assert_equals(factorial(6), 720)
test.assert_equals(factorial(3), 6)