def condenseSpaces(s):
 s = s.replace('\n', ' ')
 s = spacere.sub(' ', s)
 return s.strip()

def condenseSpaces ( s ) : s = s . replace ( '\n' , ' ' ) s = spacere . sub ( ' ' , s ) return s . strip ( )
remove any line enedings and condense multiple spaces .