python用一个列表中的成员,分割另外一个列表, 成为多个列表
def split_a_with_members_in_b( \
a=[1,2,3,4,5,6,3,4,5,8],
b=[3,5]):
res = []
b0 = a.index(b[0])
a = a[b0:] + a[:b0]
print(f'{a,b = }')
j = 0
res.append([])
while len(a)>1:
if a[1] not in b:
res[j].append(a[1])
a = a[1:]
else:
a = a[1:]
j += 1
res.append([])
print(f'{res = }')
return res