I do this exercise with this code (and its works):

```
def factorial(x):
total = 0
if x == 1 or x == 0:
return 1
else:
total = x * factorial(x - 1)
return total
```

But i want to know does it really work by giving parameters

And i got this error:

Traceback (most recent call last):

File "python", line 7, in

File "python", line 6, in factorial

TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

**how fix to fix that?**

```
def factorial(x):
total = 0
if x == 1 or x == 0:
return 1
else:
total = x * factorial(x-1)
print factorial(3)
```