This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def factorial(n): | |
'''factorial(n) returns the product of the integers 1 through n for n >= 0, | |
otherwise raises ValueError for n < 0 or non-integer n''' | |
# implement factorial_iterative and factorial_recursive below, then | |
# change this to call your implementation to verify it passes all tests | |
... | |
return factorial_iterative(n) |