A = [1,2,3,4,5,6]B = A[:len(A)//2]C = A[len(A)//2:]
如果需要功能:
def split_list(a_list): half = len(a_list)//2 return a_list[:half], a_list[half:]A = [1,2,3,4,5,6]B, C = split_list(A)
欢迎分享,转载请注明来源:内存溢出
A = [1,2,3,4,5,6]B = A[:len(A)//2]C = A[len(A)//2:]
如果需要功能:
def split_list(a_list): half = len(a_list)//2 return a_list[:half], a_list[half:]A = [1,2,3,4,5,6]B, C = split_list(A)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)