I get 1 as a result regardless of what I put in.

I'm assuming this means my code is not looping; however I can't figure out which part is causing this.

```
def factorial(x):
for i in range(x):
result = 1
if i > 0 :
while i > 0:
result == result * i
i += 1
return result
else:
return result
```