def read_yes_no(msg: str, default=True) ->bool:
    """
    Reads in a yes/no response from the user and returns a bool indicating
    the response. The msg will be displayed as |$msg [Yes/no]: |. |default| is
    the default between yes/no.
    """
    while True:
        response = input(f"{msg} {'[Yes/no]' if default else '[yes/No]'}: "
            ).strip().lower()
        if response == '':
            return default
        elif response in ('yes', 'y'):
            return True
        elif response in ('no', 'n'):
            return False
        print("Sorry, I don't understand that")
