Python 3: check if the entire list is inside another list <p>Let's say I have 2 lists:<br> <code>a = [6,7,8,9,10]</code><br> <code>b = [1,3,4,6,7,8,9,10]</code> </p> <p>I have a function that is used to find out if <em>list a</em> can be found in <em>list b</em>. If it is found, then it returns <strong>True</strong>. In my case it should return <strong>True</strong> because <em>list a</em> can be found at the end of <em>list b</em>. <em>List a</em> never changes and always contains the same numbers, whereas <em>list b</em> accepts numbers from the user and then uses <code>sorted()</code> method to sort numbers in ascending order. I should also add that the order does matter. </p> <p>I have searched around and could find a subset method, which looks like this: <code>set(a).issubset(set(b)))</code> as well as using <code>in</code> method. Both of them did not work for me.</p> <p><strong>UPDATE</strong>: Using <code>set(a).issubset(set(b)))</code> for some reason always returns True. For example, if <code>a = [1,1]</code> and <code>b = [0,1,2,3,4,5]</code> then using subset method returns True, even though 1,1 cannot be found in b. I'm not looking if 1 is inside the list, I'm looking if 1,1 is inside the list.</p> <p>Using <code>in</code> method when<br> <code>a = [6,7,8,9,10]</code><br> <code>b = [1,3,4,6,7,8,9,10]</code> returns False.</p>