UPDATE with OP code posted now:
while len(selected_elem) < int(user_input):
if 1 <= int(user_input) <= 5:
random_elem = random.randrange(1, 10, 1)
if random_elem not in selected_elem:
selected_elem.append(random_elem)
else:
print ("That is not an option...")
Note that if the input to user_input is not a number and int() fails your program will crash (throw an exception). You can graft on the try/except code shown below to deal with that if necessary.
------ Previous answer w/o code posted by OP ------------
If you can be sure the input will always be a number you can do this:
while True:
num = input('Enter number between 1 - 5:')
if 1 <= num <= 5:
print 'number is fine'
break
else:
print 'number out of range'
It will continue to loop until the user enters a number in the specified range.
Otherwise, the added try/except code will catch non-numeric input:
while True:
try:
num = input('Enter number between 1 - 5:')
if 1 <= num <= 5:
print 'number is fine'
break
else:
print 'number out of range'
except NameError:
print 'Input was not a digit - please try again.'
If you don't want the user to try again after entering a non-number, just adjust the message and add a break statement below the final print to exit the loop.