Procedure is not working in the way it should? : <p>I've been told to write a procedure to find the last position of a substring in a string. It seems to be outputing false information and I'm not sure where I've gone wrong.</p>

<p>Can anyone help?</p>

<pre><code>def find_last(s, c):
    last_position = -1

    while s.find(c) != -1:
        last_position = s.find(c)
        s = s[last_position + len(c):]

    return last_position


print(find_last('aaaa', 'a')) # returns 0, but the last position is 3
</code></pre>
