def yes_or_no(question):
    """
    Prompts user to answer a yes or no question through keyboard input.
    Inputs:
        question - String containing question to ask.
    Outputs:
        answer - Boolean where True indicates that yes was selected and where
                 False indicates that no was selected.
    """
    # Set of acceptable answers
    yes = set(['yes', 'y'])
    no = set(['no', 'n'])
    
    # Iterate till answer is given
    while True:
        answer = input(question + "(y/n): ").lower().strip()
        if answer in yes:
            return True
        elif answer in no:
            return False
        else:
            print("Please respnd with 'yes' or 'no'")