I am beginner programmer. I am trying to write a code with this requirement that user input must be number 1-20 and also that it is not a letter.

Requirement on my code:

* while loop i.e while(true)
* isDigit()

I started with this code, but I don't know how to implement the isDigit method. I assume it has to be nested within the while loop.

```
    while(input < 1 || input > 20){
        System.out.println("Invalid number! Try again.");
        input = s.nextInt();
        s.nextLine();
    }
    return input;
}

```

I have tried using "if" statement and using another "while" loop but it didn't work. Much appreciated.