## factorial()


Compute the factorial of a non-negative integer.


Usage


``` python
factorial(n)
```


Returns the product of all positive integers less than or equal to `n`. By convention, `factorial(0)` is 1.


## Parameters


`n: int`  
A non-negative integer whose factorial is to be computed.


## Returns


`int`  
The factorial of `n`.


## Raises


`ValueError`  
If `n` is negative.


## Examples

``` python
>>> factorial(5)
```

120

``` python
>>> factorial(0)
```

1

Factorials grow very quickly:

``` python
>>> factorial(10)
```

3628800

``` python
>>> factorial(20)
```

2432902008176640000

Works with small values too:

``` python
>>> factorial(1)
```

1

``` python
>>> factorial(2)
```

2
