Merge two dictionaries into one using Python.
dict1 = {'a': 1, 'b': 2}
dict2 = {'c': 3, 'd': 4}
def merge_dictionaries(dict1, dict2):
    res = {**dict1, **dict2} 
    return res

print(merge_dictionaries(dict1, dict2)) # Output: {'a': 1, 'b': 2, 'c': 3, 'd': 4}