title: How to type negative number with .isdigit?
body: <p>when I try this</p>
  
  <pre><code>if question.isdigit() is True:
  </code></pre>
  
  <p>I can type in numbers fine, and this would filter out alpha/alphanumeric strings</p>
  
  <p>when I try 's1' and 's' for example, it would go to (else).</p>
  
  <p>Problem is, when I put negative number such as -1, '.isdigit' counts '-' sign as string value and it rejects it. How can I make it so that '.isdigit' allows negative symbol '-'?</p>
  
  <p>Here is the code. Of the thing i tried.</p>
  
  <pre><code>while a &lt;=10 + Z:
      question = input("What is " + str(n1) + str(op) + str(n2) + "?")
      a = a+1
  
      if question.lstrip("-").isdigit() is True:
          ans = ops[op](n1, n2)
          n1 = random.randint(1,9)
          n2 = random.randint(1,9)
          op = random.choice(list(ops))
  
          if int(question) is ans:
              count = count + 1
              Z = Z + 0
              print ("Well done")
          else:
              count = count + 0
              Z = Z + 0
              print ("WRONG")
      else:
          count = count + 0
          Z = Z + 1
          print ("Please type in the number")
  </code></pre>