title: Python Prime Numbers Loop
body: <p>When running this code, I keep having an error. I would like to know what is wrong. The code has to be able to read words and integers and repeat the prompt(Please enter an integer >= 2: ') until it is greater or equal to 2. Thanks in advance.</p>
  
  <pre><code>def prime_number():
  
      prime_num = input('Please enter an integer &gt;= 2: ')
  
      while not(prime_num.isdigit() and int(prime_num)&lt;1):
  
          prime_num = input('Please enter an integer &gt;= 2: ')
  
      for i in range(2,int(prime_num)+1):
          for x in range(2,i):
              if i%x == 0:
                  break
          else:
              print (i)
  </code></pre>