title: How to compare strings before starting a loop in python
body: <p>Hi I am pulling a variable, call it x, from urllib.request.urlopen</p>
  
  <p>I then want to make a float comparison.</p>
  
  <p>However, as this variable can vary, and be unavailable, it is occasionally "N/A"</p>
  
  <p>this is my comparison</p>
  
  <pre><code>    x = (sourceCode.split)('sourcesnippet1')[1].split('sourcesnippet2')[0]
      if 0 &lt; float(x) &lt; 1:
          print (entity, 'meets requirements')
          print (x)
  </code></pre>
  
  <p>how can I make it so that pseudo:</p>
  
  <pre><code>chek = 'N/A'
              x = (sourceCode.split)('sourcesnippet1')[1].split('sourcesnippet2')[0]
  if str(x) == chek TRUE, then go to next query
  else
              if 0 &lt; float(x) &lt; 1:
                  print (entity, 'meets requirements')
                  print (x)
  </code></pre>