<p>我必须检查list1是否包含在list2中。它还应该检查它是否也按该顺序出现在列表中。如果它是真的,那么它应该返回真和假</p>
<pre><code>def check(lst1, lst2):
for x in lst1:
for y in lst2:
xx = lst1.sort()
yy = lst2
if xx != yy:
return False
else:
return True
</code></pre>
<p>我把自己和for循环搞混了,而且,我不知道从这里到哪里去修复我的代码。请指点一下?</p>
<p>它应该做什么的例子:</p>
<pre><code> check([4,0],[9,1,4,6,8,9])
True
check([1,2],[2,3,1])
False
</code></pre>