Write a Python program to compare two dictionaries to check if they are equal.
d1 = {'a':1, 'b':2, 'c':3}
d2 = {'a':1, 'b':2, 'c':4}
def compare_dicts(dict1, dict2):
    if dict1 == dict2:
        return True
    return False

result = compare_dicts(d1, d2)
print(result)