human
Can you show me a Python function to compress multiple white space to single space? Can you show a Python Function to compress multiple spaces to single space in a Python program.
assistant
Here is a Python function to compress multiple white space to single space

import re

def compress_whitespace(text):
    """ Compress multiple white space to single """
    return re.sub(r'\s+','', text)

# Enter the text
text = "Hello \n World"

# Calling the function
print((compress_whitespace(text)))

#Example Output
# HelloWorld

#Remember to inspect code for bugs.