title: Python: Find a substring in a string and returning the index of the substring
body: <p>I have: </p>
  
  <ul>
  <li><p>a function: <code>def find_str(s, char)</code></p></li>
  <li><p>and a string: <code>"Happy Birthday"</code>,</p></li>
  </ul>
  
  <p>I essentially want to input <code>"py"</code> and return <code>3</code> but I keep getting <code>2</code> to return instead. </p>
  
  <p><strong>Code:</strong> </p>
  
  <pre><code>def find_str(s, char):
      index = 0           
      if char in s:
          char = char[0]
          for ch in s:
              if ch in s:
                  index += 1
              if ch == char:
                  return index
  
      else:
          return -1
  
  print(find_str("Happy birthday", "py"))
  </code></pre>
  
  <p>Not sure what's wrong!</p>