title: How to use comparison and ' if not' in python?
body: <p>In one piece of my program I doubt if i use the comparison correctly. i want to make sure that ( u0 &lt;= u &lt; u0+step ) before do something. </p>
  
  <pre><code>if not (u0 &lt;= u) and (u &lt; u0+step):
      u0 = u0+ step # change the condition until it is satisfied
  else:
      do something. # condition is satisfied
  </code></pre>