First page Back Continue Last page Overview Graphics

Using the Module

>>> import example

>>> example.fact(10)

3628800

>>>

>>> example.fact(0)

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ValueError: Expected a positive value.

>>>

>>> example.fact(-1)

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ValueError: Expected a positive value.

>>>