So im very new to Python 2.7 and i was wondering how to loop my following code:

```
def factors(n):

    results = set()
    for i in xrange(1, int(n**0.5)+1):
        if n % i == 0:
            results.add(i)
            results.add(n / i)
    return results

user_input = int(raw_input("Enter an integer: "))
print(factors(user_input))

```

I would like to be able to enter an integer, get the results and go back to entering another one. I have tried playing with "while True:" loops but couldn't get it to work.
Could someone show me how and why to do it please? 
Thanks