def confirm(msg):
    """
    Ask the user to confirm by pressing Y or N (case-insensitive)
    Args:
        msg (string): The question to ask the user
    returns:
        True if the answer is Y
    """
    answer = ""
    while answer not in ["y", "n"]:
        answer = input(msg + " [Y/N] ").lower()

    return answer == "y"