dynamic_programming.factorial

Functions

factorial(→ int)

Module Contents

dynamic_programming.factorial.factorial(num: int) int
>>> factorial(7)
5040
>>> factorial(-1)
Traceback (most recent call last):
  ...
ValueError: Number should not be negative.
>>> [factorial(i) for i in range(10)]
[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]