Write a Python program that accepts two lists of equal length as input and computes the dot product of the two lists. If the lengths are not equal, the program should raise an exception and exit gracefully. PLAINFORMAT
def dot_product(list1, list2):
    if len(list1) != len(list2):
        raise ValueError("Lists must be of equal length")
    
    return sum(x * y for x, y in zip(list1, list2))

try:
    list1 = [int(x) for x in input("Enter elements of first list separated by space: ").split()]
    list2 = [int(y) for y in input("Enter elements of second list separated by space: ").split()]

    result = dot_product(list1, list2)
    print("Dot product:", result)

except ValueError as e:
    print(e)