Can you generate code to clear all whitespace from a given string in Python?
Input String = " Hello World    "
def clear_whitespace(s):
        s = s.strip() # Remove leading and trailing whitespaces
        s = "".join(s.split()) # Remove middle whitespaces
        return s

print(clear_whitespace(" Hello World    "))