Hey everyone, i wonder why my program gets stuck in infinite loop?

```
b = raw_input("Enter a positive number : ")
def factorial(x):
i = 1
a = 1
while x < 0:
x = raw_input("Enter a valid number (0 or positive)")
while i <= x:
a = i*a
i = i+1
x = a
return x
factorial(b)
```