title: Reduce a while-loop condition - python
body: <p>I'm trying to create a constraint so that the &quot;lettera&quot; input variable is a letter of the alphabet between a and h on this code *1 but I think there's a better way to write the condition for the loop.</p>
  <p>Thanks if someone could help me figuring out how re-write it smaller.</p>
  <p>*1</p>
  <pre><code>while (lettera != 'a' and lettera != 'b' and lettera != 'c' and lettera != 'd' and lettera != 'e' and lettera != 'f' and lettera != 'g' and lettera != 'h'):
      lettera= input('Inserisci un valore lettera a-h ')
  </code></pre>