from pathlib import Path


def save_task(text: str, filepath: str,):
    """Writes each text on 1 line at the end of the file.
    Strips text from newlines so that it can be written on a single line.

    Args:
        text (str): the text, will be stripped of newline
        filepath (Path): the path to the file
    """
    with Path(filepath).open('a', encoding='utf-8') as f:  # mode 'a' to append lines
        f.write(f"{text.strip()}\n")
    return 1