<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_fasta(file_path, seq_list, name_list=None):
 """Write a fasta file # Arguments file_path: file path seq_list: List of strings name_list: List of names corresponding to the sequences. If not None, it should have the same length as `seq_list` """

    if name_list is None:
        name_list = [str(i) for i in range(len(seq_list))]

    # needs to be dict or seq
    with open(file_path, "w") as f:
        for i in range(len(seq_list)):
            f.write(">" + name_list[i] + "\n" + seq_list[i] + "\n")