a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]b=[True,False,False,True,False,False]t,f=[],[]for i in range(len(a)): if i >= len(b): c=i%(len(b)) if b[c]==True: t.append(a[i]) else: f.append(a[i]) else: if b[i]==True: t.append(a[i]) else: f.append(a[i])print(t,f)
时间: 2024-11-05 16:07:23