def yesNo(msg, loop=True, incorrmsg="Please answer yes or no. "):
    """Asks a user msg where the reponse shoud be yes or no.

    Args:
        msg (str): message to be asked of user
        loop (bool): Whether to loop on invalid input or not
        incorrmsg (str) [optional]: message to be printed if the user enters an invalid
        input.
    Returns:
        True if the user answers yes
        False if the user answers no
    """
    first = True
    while loop or first:
        first = False
        i = input(msg)
        if i[0].lower() == 'y':
            return True
        elif i[0].lower() == 'n':
            return False
        print(incorrmsg)