#NEWLINE# def fuse( array , separator ) : #NEWLINE# #INDENT# if ( ( type ( array ) != type ( [ ] ) ) and ( type ( array ) != type ( ( ) ) ) ) : #NEWLINE# #INDENT# raise Exception ( 'Fused object must be a list or a tuple.' ) #NEWLINE# #UNINDENT# if ( type ( separator ) != type ( '' ) ) : #NEWLINE# #INDENT# raise Exception ( 'Separator must be a string.' ) #NEWLINE# #UNINDENT# array_length = len ( array ) #NEWLINE# if ( array_length > 1 ) : #NEWLINE# #INDENT# result = '' #NEWLINE# for i in range ( 0 , array_length ) : #NEWLINE# #INDENT# result += array [ i ] #NEWLINE# if ( i < ( array_length - 1 ) ) : #NEWLINE# #INDENT# result += separator #NEWLINE# #UNINDENT# #UNINDENT# return result #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( i == 1 ) : #NEWLINE# #INDENT# return array [ 0 ]