[Tutor] another better way to do this ?

Emile van Sebille emile at fenx.com
Sun Jan 12 21:11:26 CET 2014


On 01/12/2014 06:43 AM, Dave Angel wrote:
>   Roelof Wobben <rwobben at 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

Emile







More information about the Tutor mailing list