Pattern Matching Python
<p>I'm currently stuck on trying to make a naive algorithm which given a piece of a  pattern e.g aabba 
search for it in a text e.g abbbbaababaabbaaabbaa one letter at a time. It will compare a with the text if that is right then compares the next letter and if that's wrong the whole pattern will shift one and compare a with b etc </p>

<p>we were give code example</p>

<pre><code>print "Input text: ",
text = raw_input()
print "Input pattern: ",
pattern = raw_input()

index = text.find(pattern)
while index &gt; -1:
    print index
    index = text.find(pattern, index+1)
</code></pre>

<p>but the find() function in python is too fast(I need a non optimized sort of algorithm, using while
and for loops statements I guess).</p>

<p>Any help appreciated,
Thanks </p>
