import csv


def save_to_csv(data: list, file_name: str) -> bool:
    """
    Saved given data to .csv file.

    Parameters
    ----------
    data: list, required
        Data produced by function prepare_data_to_save().
    file_name: str, required
        Path and file name to where save file. It should not include ".csv" at
        the end.

    Returns
    -------
    True if file created or false if not.

    Example
    -------
    >>> save_to_csv(prepare_data, 'test')
    """

    with open(f'{file_name}.csv', 'w+', newline='') as csvfile:
        fieldnames = ['name', 'date', 'amount']
        writer = csv.writer(csvfile)
        writer.writerow(fieldnames)

        for value in data:
            writer.writerow(value)

    if writer:
        return True
    else:
        return False