Develop a Python function that takes two strings as input and returns the longer string.
'cat', 'dog'
def longer_string(string1, string2):
    if len(string1) > len(string2):
        return string1
    else:
        return string2