def result(problem, action):
    """The outcome of applying an action to the current problem"""
    if action is not None:
        problem.act(action)
        return problem
    else:
        return problem
