def get_and_remove_or_default(dict, key, default):
    """
    Get an item from a dictionary, then deletes the item from the dictionary.
    If the item is not found, return a default value.
    :return: The value corresponding to the key in the dictionary, or the default value if it wasn't found.
    """
    if key in dict:
        ret = dict[key]
        del dict[key]
        return ret
    else:
        return default