title: Why do we not need "else" in an if-statement if it contains "return"?
body: <p>I'm a beginner in Python, and I can't understand why we don't have to use <code>else</code> in cases like the one below:</p>
  
  <pre><code>def find_element(p,t):
       i=0
       while i&lt;len(p):
         if p[i]==t:
           return i
         i=i+1
       return -1
  </code></pre>
  
  <p>In this code I thought I should use <code>else return -1</code> if I wanted to return -1, but it seems that python understands this without <code>else</code> like in the code above.</p>