Is a break statement required or is the return statement enough?
<p>In my Python 3(.5) script I have a simple <code>for</code> loop, that looks like this:</p>

<pre><code>request = "simple string"
ignore = (
  # Tuple that contains regex's to ignore
)
for (i, regex) in enumerate(ignore):
  if re.search(regex, request):
    print("Found regex {0}.".format(i))
    return False
</code></pre>

<p>Now, this works as expected and the loop stops on the first match that is found.<br />
I understand that the <code>break</code> statement is what is used to break loops in Python.<br />
Knowing this lead to the question: <strong><em>Must</strong> I use the <code>break</code> statement to break a loop or could I get away with using the <code>return</code> statement instead?</em></p>

<p>Keeping this question in mind, would it be better off for my code to look like this:</p>

<pre><code>request = "simple string"
ignore = (
  # Tuple that contains regex's to ignore
)
for (i, regex) in enumerate(ignore):
  if re.search(regex, request):
    print("Found regex {0}.".format(i))
    break
</code></pre>