def lowstrip ( term ) : term = re . sub ( '\s+' , ' ' , term ) term = term . lower ( ) return term
remove spaces and punctuation python
Convert to lowercase and strip spaces
def lowstrip(term):
    """Convert to lowercase and strip spaces"""
    term = re.sub('\s+', ' ', term)
    term = term.lower()
    return term