# next prime number

Hi, I wrote code to find the next prime number. It works only if I put the number on the code. However I'm trying to find a way to have a range of numbers that the user can pick from. Here is the code:

```
num = (sage_input('Please enter test integer > 2: ')
# num =120
def is_prime(num):
for i in range(2,num):
if (num % i) == 0:
return False
return True
num = num + 1
while is_prime(num) == False:
num = num + 1
print num, 'is your next prime.'
```