(message, default=False)
return default
Request a y/n input from a question.
    Will check for variants such as "true", "yep", "nope", "i think not", etc.
Request a y/n input from a question.
    Will check for variants such as "true", "yep", "nope", "i think not", etc.
Request a y / n input from a question . Will check for variants such as true yep nope i think not etc .
def yes_or_no(message, default=False):
    """Request a y/n input from a question.
    Will check for variants such as "true", "yep", "nope", "i think not", etc.
    """
    result = input('{} (y/n) '.format(message)).lower()
    if not result:
        return default
    elif result[0] in ('y', 't', '1'):
        return True
    elif result[0] in ('n', 'f', '0'):
        return False
    elif 'n' in result:
        return False
    elif 'y' in result:
        return True
    return default
def yes_or_no ( message , default = False ) : result = input ( '{} (y/n) ' . format ( message ) ) . lower ( ) if not result : return default elif result [ 0 ] in ( 'y' , 't' , '1' ) : return True elif result [ 0 ] in ( 'n' , 'f' , '0' ) : return False elif 'n' in result : return False elif 'y' in result : return True return default