title: how can i return something and break the loop same time in python
body: <pre><code>while True:
      if abs(func_value) &lt; epsilon:
          return (x_0, itNum)
      if abs(func_value) &lt; epsilon:
          break
  
      else:
          assert deriv_value != 0
          x_0 = x_0 - (func_value / deriv_value)
          itNum += 1
  </code></pre>
  
  <p>I do not want to write twice the condition. Is there another way to write this more appropriate?</p>
  
  <p>i am so sorry guys,,  </p>
  
  <p>actually it continues with else statement that updates the func_value . i have just fixed</p>