Create a slugify function in Python that converts a sentence into a valid URL slug.
This Is a Test
def slugify(string):
    slug = string.lower().strip().replace(' ', '-')
    return slug

slug = slugify("This Is a Test")
print(slug)