def seq2str(sequence, quote="'", sep=', ', lastsep=' and '):
 sequence = [((quote + unic(item)) + quote) for item in sequence]
 if (not sequence):
  return ''
 if (len(sequence) == 1):
  return sequence[0]
 last_two = lastsep.join(sequence[(-2):])
 return sep.join((sequence[:(-2)] + [last_two]))

def seq2str ( sequence , quote = "'" , sep = ', ' , lastsep = ' and ' ) : sequence = [ ( ( quote + unic ( item ) ) + quote ) for item in sequence ] if ( not sequence ) : return '' if ( len ( sequence ) == 1 ) : return sequence [ 0 ] last_two = lastsep . join ( sequence [ ( - 2 ) : ] ) return sep . join ( ( sequence [ : ( - 2 ) ] + [ last_two ] ) )
returns sequence in format item 1 .