def merge_sequences(target, other, function=operator.add):
 assert (len(target) == len(other)), 'sequence lengths must match'
 return type(target)([function(x, y) for (x, y) in zip(target, other)])

def merge_sequences ( target , other , function = operator . add ) : assert ( len ( target ) == len ( other ) ) , 'sequence lengths must match' return type ( target ) ( [ function ( x , y ) for ( x , y ) in zip ( target , other ) ] )
merge two sequences into a single sequence .