title: How can i restrict letters after a number in an input in Python
body: <p>I'm a begginer in python and i wanted to know how can i restrict characters after another, in my case, after a number.
  In this code i want the user to give me a couple of characters, like &quot;SDK70&quot; and print is as valid.
  But if the user inputs &quot;SDK7S0&quot; it will print it as invalid.
  How can i do this? This is my code so far:</p>
  <pre><code>str = input(&quot;str here: &quot;)
      
  while len(str) &lt;= 6 and len(str) &gt;= 2:
      if str[0:2].isupper() == True:
          return str
  
  # if there is a number, return false if after the number there's a let
  </code></pre>