Write a Python function to access a given key from a given dictionary.
d = {'x': 3, 'y': 4, 'z': 5}
def access_key(key, dictionary): 
    if key not in dictionary: 
        return -1
    return dictionary[key]