x = int(eval(input('Pick between 1,2,3,4,5: ')))
while x not in [1, 2, 3, 4, 5]:
    print('This is not a valid input, please try again')
x = int(eval(input('Pick between 1,2,3,4,5: ')))
print('You picked {}'.format(x))
Python — перезапуск оператора if, если введено неверное значение