title: How can I make a Validation Try and Except Error for this?
body: <p>I have this code as shown below and I would like to make a function which has a try and except error which makes it so when you input anything other than 1, 2 or 3 it will make you re input it. Below is the line which asks you for your age.</p>
  
  <pre><code>    Age = input("What is your age? 1, 2 or 3: ")
  </code></pre>
  
  <p>Below this is what I have so far to try and achieve what I want.</p>
  
  <pre><code>   def Age_inputter(prompt=' '):
          while True:
              try:
                  return int(input(prompt))
              except ValueError:
                  print("Not a valid input (an integer is expected)")
  </code></pre>
  
  <p>any ideas?</p>