def load_txt(fname, mode='r'):
    """Loads a .txt file to memory.

    Parameters
    ----------
    fname : str
        File name + path.
    mode : str, optional
        File open mode.

    Returns
    -------
    list of strings

    """
    assert fname, 'Must input a valid file name.'
    with open(fname, mode=mode, encoding="utf-8") as f:
        data = f.read()
    split_lines = data.split('\n')
    return split_lines[:-1]