Create a Python function that takes two lists, compare them, and return True if both lists are identical and False if they differ.
list1 = [1, 2, 3]
list2 = [1, 2, 3]
def compare_lists(list1, list2):
    if len(list1) != len(list2):
        return False

    for i in range(len(list1)):
        if list1[i] != list2[i]:
            return False

    return True