Emile van Sebille wrote: > On 01/12/2014 06:43 AM, Dave Angel wrote: >> Roelof Wobben <rwob...@hotmail.com> Wrote in message: >> >> That documentation says nothing about order. And the test cases >> specifically contradict it. >> >> so try >> >> if set (b) <= set (a): > > or, as the OP specified, if order is relevant, > > def test(a,b): > for ii in a: > if ii not in b: a=a.replace(ii,"") > return b in a
>>> def test(a,b): ... for ii in a: ... if ii not in b: a=a.replace(ii,"") ... return b in a ... >>> test("axbxc", "abc") True >>> test("abbxc", "abc") False Is the second result desired? _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor