title: How can I determine if user input is a valid hexadecimal number?
body: <pre><code>#Hex Check
  def Check():
      while False:
          for char in UserInput:
              if char not in Valid:
                  print ('That is an invalid hex value.')
          print('That is a valid hex value.')
          return Check
  
  UserInput=input('Enter a hex number: ')
  Valid='1''2''3''4''5''6''7''8''9''10''A''B''C''D''E''F'
  </code></pre>
  
  <p>EDIT: I've tried this. When I enter a hex value e.g. B2 no message comes up.</p>