import csv


def create_csv(data, local=True) -> None:
    """Stores pulled CSV-formatted data from Covid-19 API into a CSV.

    :param data: CSV-formatted data, as a list.
    :param local: Boolean value dictating whether the function should update the local or national data.
    :return: None-type.
    """
    if local:
        file_name = "local_data.csv"
    else:
        file_name = "national_data.csv"
    with open(file_name, "w", newline="") as csv_file:
        file = csv.writer(csv_file, delimiter=",")
        for line in data:
            file.writerow(line)
    return None