Comparing element order in Python lists
<p>I am trying to write a function that returns <code>True</code> if the elements in <code>lst1</code> appear in <code>lst2</code> in the same order as they appear in <code>lst1</code>, but not necessarily consecutively.</p>

<p>For example,</p>

<p><code>test([29, 5, 100], [20, 29, 30, 50, 5, 100])</code> should return <code>True</code>.</p>

<p><code>test([25, 65, 40], [40, 25, 30, 65, 1, 100])</code> should return <code>False</code>.</p>

<p>Here is what I have so far:</p>

<pre><code>def test(lst1, lst2):
    for i in range(len(lst1)-len(lst2)+1):
        if lst2 == lst1[i:i+len(lst2)]:
            return True 
    return False 
</code></pre>
