def input_yesno(prompt, default=None):
    """
    ask the user to enter Yes or No

    prompt: string to be shown as prompt
    default: True (=Yes), False (=No), or None (can not leave empty)
    """
    while True:
        value = input(prompt).strip()
        if not value:
            if default is None:
                print('Can not leave empty')
                continue
            else:
                return default
        value = value.lower()
        if value in ('y', 'yes'):
            return True

        if value in ('n', 'no'):
            return False

        print('Enter Yes or No')