Write a function in Python to remove a specific character from a string.
string = "Hello World"
character = 'l'
def remove_character(string, character):
    return string.replace(character, '')

print(remove_character(string, character))