def nice_join(seq, sep=', '):
 seq = [str(x) for x in seq]
 if (len(seq) <= 1):
  return sep.join(seq)
 else:
  return ('%s or %s' % (sep.join(seq[:(-1)]), seq[(-1)]))

def nice_join ( seq , sep = ', ' ) : seq = [ str ( x ) for x in seq ] if ( len ( seq ) <= 1 ) : return sep . join ( seq ) else : return ( '%s or %s' % ( sep . join ( seq [ : ( - 1 ) ] ) , seq [ ( - 1 ) ] ) )
join together sequences of strings into english-friendly phrases using the conjunction or when appropriate .