def getAnswer (answer):
    """
    Function to get YES or NO answer from the user
    usage: x = getAnswer('mensage to display ')
    """
    while True:
        user_input = input(answer).lower()
        if user_input != "y" and user_input != "n":
            print('Use Y for yes and N for no')
        else:
            return user_input